|
-
Jan 30th, 2002, 07:20 AM
#1
Thread Starter
Fanatic Member
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,
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Jan 30th, 2002, 07:46 AM
#2
Lively Member
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
-
Jan 30th, 2002, 07:53 AM
#3
Thread Starter
Fanatic Member
it brings up lots of syntax errors....
/: Tim :\____________________
\: VB, HTML, ASP, VBScript, QBASIC, JavaScript :/
-
Jan 30th, 2002, 08:04 AM
#4
Lively Member
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
-
Jan 30th, 2002, 11:05 AM
#5
Frenzied Member
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>");
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|