danieljph wrote:@ABooth: First and foremost, thank you for taking a moment to address this little kink I've wrapped myself around.
Logic-wise, I'm right there with you.
However, I'm stumbling a bit over the syntax. Do you think you might walk me through its proper execution?
iMacros v. Javascript
<SP> v. %20
I'm no stranger to trial and error--but any guidance you might offer would be greatly appreciated. I'm surprised I've made it this far, only to realize I have so much more yet to learn.
-Daniel
Well, if you need to represent a space in your im macro file, you would replace spaces with <sp>. This is iMacros specific syntax.
The %20 is a URL encoded representation of a space character, because a space (as well as some other characters) are not allowed in a url.
Both <sp> and %20 do the same thing, they just represent space characters for different uses. <sp> in an iim file and %20 as part of a URL
%20 means hexadecimal 20. This is the numeric representation of a space character.
If you wanted to go to the windows "C:\Program Files" folder in a web browser, the path would be: -
where: -
- file:// is the protocol (like http:// for web pages, ftp:// for file transfer protocol etc)
- /C:/Program%20Files/ is the path. Note the space has been replaced with %20, which the browser parses as space.
In fact, you can get any character and url encode them. Just find out what the hexadecimal value is and prefix with %
So 'A' , which is character 65 decimal can be represented as %41 as 41 is hexadecimal for 65 decimal
It is not uncommon to obfuscate urls to make hacking that bit more difficult.
Paste the following into
IE (not Firefox) address bar as an example
Code: Select all
http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D
In javascript, you would not need to use url encoding, unless you were doing something like a redirect to a url that had spaces in it.
If you need to mark the spaces for the javascript in the iim script, use <sp>, because it's still an iMacro.
The iMacro code (iim file) would look like this:-
Code: Select all
URL GOTO=javascript:if(frames.length<1)<SP>document.write("<input<SP>type='hidden'<SP>id='iMacroExtract'<SP>value<SP>=<SP>'"<SP>+<SP>document.links.length<SP>+<SP>"'<SP>/>");
TAG POS=1 TYPE=INPUT:HIDDEN ATTR=ID:iMacroExtract EXTRACT=TXT