Page 1 of 1

How to call Javascript functions on websites

Posted: Wed Dec 19, 2007 11:13 am
by Tech Support
You can use the URL GOTO command to execute Javascript functions on websites. If you do this, please remember to replace space " " with "<SP>".

Example: A simple Javascript bookmarklet to count links:

Code: Select all

javascript:if(frames.length<1){alert('This page has'+document.links.length+' links.')}else{alert('The page has frames!')}
After you replace " " with "<SP>" the command looks like:

Code: Select all

URL GOTO=javascript:if(frames.length<1){alert('This<SP>page<SP>has<SP>'+document.links.length+'<SP>links.')}else{alert('The<SP>page<SP>has<SP>frames!')}

Re: How to call Javascript functions on websites

Posted: Thu Mar 12, 2009 2:57 pm
by crfutu
it's helpful

Re: How to call Javascript functions on websites

Posted: Tue Nov 17, 2009 1:26 am
by danieljph
Dear Tech Support,

Is it possible to pass the document.links.length var onto test.js when it is executed from within iimPlay("CODE:...")? Executing the document.links.length if/else from within test.js returns "The page has frames!" which I believe might be due to the iMacros sidebar. Thanks in advance.