Forum Moderators: open
The function to get a substring looks like this:
linkURL = callingURL.substring(...stuff...)
Look carefully at what goes in the brackets where I wrote ...stuff...
callingURL.indexOf('?')+1,callingURL.length
Do you see how it's got two parts separated by a comma? Good. Each part (we like to call them arguments) means something different. The first argument specifies where in callingURL to start getting the substring, and the second argument specifies where to stop getting the substring.
In this case, it's saying "start at the character AFTER the first character that is a question mark, and stop at the last character".
The +1 is the bit that says AFTER. That's because it'll find the question mark, and then one more is the character after the question mark.
I hope that makes sense! If not, search Google for a tutorial that explains substring() better than I can.
Here's what's going on:
<frame src="' + linkURL + '" name="content" \/>
the linkURL is a string variable which contains the URL for the frame. It has the + signs on either side of it so that the writeln command knows that it isn't done with that line yet.
basically the entire line is saying:
Write '<frame src="' AND write the value of linkURL AND write '" name="content" \/>'
The \/ part tells the writeln command that the / is not the start of a special character.
Does that help?
*edited for clarification