[Duncan's Home] Duncan's Jotter
faq -  feedback -  home 
Members
Logon   -   Sign Up

RE: Weblogger bookmarklet

Msg#726 - RE: Weblogger bookmarklet

In response to: 92 | <<Back | Next>> | Top of Thread | View Full Thread | Reply | Edit

Posted: 12/11/2000 by David Carter-Tod
Modified: 12/11/2000 by David Carter-Tod

Don't know if it's an issue for you, but I have version that works for frames and iframes in IE (written for manila, but I'm sure this works for conversant too).

javascript:function findFrame(f){var i;try{isThere=f.document.selection.createRange().text;}catch(e){isThere='';}if(isThere==''){for(i=0;i<f.frames.length;i++){findFrame(f.frames[i]);}}else{s=escape(isThere);}}var s='';findFrame(window);d=document;void(window.open('http://yoursite.whatever.com/newsItems/edit/new?title='+escape(d.title)+'&url='+escape(d.location)+'&selText='+s,'AddtoHomePage').focus());

The relevant code is:

function findFrame(f){
     var i;
     try{
          isThere=f.document.selection.createRange().text;
     }
     catch(e){
          isThere='';
     }
     if(isThere==''){
          for(i=0;i<f.frames.length;i++){
               findFrame(f.frames[i]);
          }
     }
     else{
          s=escape(isThere);
     }
}

var s=''; findFrame(window);

David

Enclosures:
None.

Replies:
None.

Tell ICANN to keep their hands off .org!


Run the HTML validator for this page
Webmaster: web at smeed.org