-
javascipt is wrong!!
I get a problem with this code, could someone fix it for me?
[code
document.write('<a class="connect" href='+sitemlinks[i]+'onmouseover='window.status='hello''; return true;" onmouseout="window.status=''; return true;>'+sitems[i]+'</a>');
[/code]
thanks in advance,
-
Think you got something wrong with you ' and " try this
Code:
document.write("<a class=\"connect\" href="+sitemlinks[i]+" onmouseover=\"window.status=\"hello\"\"; return true; onmouseout=\"window.status=''\"; return true;>"+sitems[i]+"</a>");
Hope this works got counfused during the " and ' things. Watch out for escaping them!
Good luck
-
it brings up lots of syntax errors.... :(
-
Oh.
How's that then? Think you should really take a look at the ' and " try to escape them using \ .
On VS6 on my system the line doesn't give any syntax error, only runtime. But that's cause I don't use your vars.
Good luck
-
You are such an idiot. Coming in here and saying that JavaScript is wrong when you give it such a crappy line,and then not bothering to try and fix it when someone points out the problem.
This is what you submitted:
Code:
document.write('<a class="connect" href='+sitemlinks[i]+'onmouseover='window.status='hello''; return true;" onmouseout="window.status=''; return true;>'+sitems[i]+'</a>');
This is what the parser sees:
Code:
document.write('<a class="connect" href='+sitemlinks[i]+'onmouseover='
This is what you should submit:
Code:
document.write("<a class=\"connect\" href=" + sitemlinks[i] + "onmouseover=\"window.status='hello'; return true;\" onmouseout=\"window.status=''; return true;\">" + sitems[i] + "</a>");