Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Link Lists & Getting Listed (http://www.greenguysboard.com/board/forumdisplay.php?f=7)
-   -   When semicolons kill... (http://www.greenguysboard.com/board/showthread.php?t=5130)

codymc12 2004-02-21 04:22 PM

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. :)

Surfn 2004-02-21 04:47 PM

Looks like this: "homegrown Video';return true" is the culprit.

codymc12 2004-02-21 06:05 PM

Hi - thanks, but I can't find that error. All I see is:

onMouseOver="window.status='Homegrown Video';return true"

codymc12 2004-02-21 06:21 PM

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. :)

Surfn 2004-02-21 06:27 PM

I missed that :( No it won't work with 3 apostrophe's.

Cleo 2004-02-21 06:27 PM

Quote:

Originally posted by codymc12
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. :)


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.

codymc12 2004-02-21 06:32 PM

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. :)

codymc12 2004-02-21 06:34 PM

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.

:)

Cleo 2004-02-21 06:51 PM

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

codymc12 2004-02-21 07:31 PM

LOL - don't do that! :)

venturi 2004-02-21 10:17 PM

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