lislis
lislis

Reputation: 394

Evernote Bookmarklet

I'm integrating a button that will launch the Evernote Bookmarklet in my project. The code for the bookmarklet is:

javascript:(function() {
       EN_CLIP_HOST='http://www.evernote.com';
               try{
                    var x=document.createElement('SCRIPT');
                    x.type='text/javascript';
                    x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+ (new Date().getTime()/100000);                                                                                                
                    document.getElementsByTagName('head')[0].appendChild(x);
                }catch(e) {     
                    location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);
                }
            })();

The code is called with an onClick event on a HTML link. My problem is what is the best way to strip off the styling for when the Evernote clips it and saves it? So that it readable?

Upvotes: 0

Views: 1127

Answers (1)

Mustafa
Mustafa

Reputation: 10413

Stripping the styling is never safe and never will be. If Evernote changes its response, your code will probably break.

You should take a look at their API instead.

Upvotes: 1

Related Questions