![]() |
When semicolons kill...
Okay... help... I'm using IE 6.0, and I keep getting an error on this page of my linklist:
http://www.touchyourmonkey.com/amateur.html It keeps saying line 216 expected ';' - I have scoured that line, and the page in general, and I'm stumped. I don't get this error on the other category pages... the only thing I can think of is that I think that's the only page I have oxcash links on... and they seem to behave strangely within the admin of my script. Anyway, if someone has too much time on their hands and can take a gander, I'd appreciate it. It's probably obvious, and I'm just not seeing it - I've been buried in html/templating code/macros for 2 days now. :) |
Looks like this: "homegrown Video';return true" is the culprit.
|
Hi - thanks, but I can't find that error. All I see is:
onMouseOver="window.status='Homegrown Video';return true" |
Solved... so silly.
Basically, it was the use of a ' within the window.status='blah blah' Specifically (in case anyone else ever runs into this): onMouseOver="window.status='Mike's Apartment';return true" SHOULD BE onMouseOver="window.status='Mikes Apartment';return true" No apostrophe in the 'Mikes' - that is what was screwing everything up. I hate code sometimes. :) |
I missed that :( No it won't work with 3 apostrophe's.
|
Quote:
You can also put a back slash in front of the apostrophe. This way it will read correctly. The back slash let JavaScript know to read the next symbol as what it is and not a function. |
Surfn - thanks for even looking! :)
Cleo - ah, I understand. I think the browser changed your backslash INTO an apostrophe... but I know what you meant. I've seen this in perl code as well - thanks for the tip. :) |
Nevermind, Cleo - I'm being a space case.
Moving, combined with working for a day and half buried in html code - it will fry the brain. :) |
I put the correct code in my post but then when the board stripped out my back slash I edited my message so your aren't being a space case I did edit my post. LOL
|
LOL - don't do that! :)
|
Yup, Cleo nailed the *real* problem with escaping the apostrophe with a backslash. However... You should always terminate that return true with a semi-colon also just for compatibility issues. Browsers are weird sometimes so it's best to be safe and ensure you go with the "standard" coding practices. :)
|
All times are GMT -4. The time now is 04:18 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc