Not Quite Resolved!
Whats wrong with back slash? The code works in testbed but wont cop the backslash on my board (ipb) ?
[/code]
Hmm... perhaps your board software is looking for escaped characters and eating them.. o_O
try either:
document.write("<a href=\\"" + link[random_num] + "\\" target=\\"_blank\\">");
document.write("<img src=\\"" + image[random_num] + "\\" border=\\"0\\"></a>");
(double backslash should be escaped to backslash by your board software which can then go on to be the javascript escape character when the page is rendered)
or (my prefered way):
document.write('<a href="' + link[random_num] + '" target="_blank">');
document.write('<img src="' + image[random_num] + '" border="0"></a>');
(all literal strings in the Javascript are quoted with single quote characters, and attributes in the dynamically created elements are quoted with double quote characters :- escaping doesn't matter) Last edited by MattEvans; Feb 14th, 2007 at 2:53 pm.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
Offline 1,091 posts
since Jul 2006