Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript is driving me mad...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 08 June 2008 :  15:07:02  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Here's one I've been working on for over 2 hours now.
Watch this in FireFox : http://www.scoutingkeentmoesel.nl/shortnews.asp?link_id=2689
You'll see a dutch topic, with a video in it.
(It's my Scouting site)

Well, open the same page with IE.
A Javascript error, and no video.
The Javascript error is non-existent in FireFox, and in IE the linenumber it refers to has no relation with javascript...

I've found out that deleting the ' in the topic message (in the part 'n onverlaat) 'fixes' it in IE....but why??!

Can anyone help me with finding out which piece of javascript goes wrong?<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 08 June 2008 15:08:14

phy1729
Average Member

USA
589 Posts

Posted - 08 June 2008 :  15:46:46  Show Profile  Reply with Quote
try a \'<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 08 June 2008 :  15:49:23  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Strangely, that works, but I also simply see a \'
It's as if the topic-content is parsed through a javascript function somewhere...but where ?
I've updated the post, so now you can see the video...
http://www.scoutingkeentmoesel.nl/shortnews.asp?link_id=2689<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 08 June 2008 15:50:51
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 08 June 2008 :  16:31:23  Show Profile  Reply with Quote
I think you're using the string in two diffrent places one doesn't need to be jsescaped namely the one you're seeing and the other does somewhere contained by single quotes. You should use chkString(var,"jsurlpath") on te second instance.<
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 09 June 2008 :  03:55:21  Show Profile  Visit MarcelG's Homepage  Reply with Quote
It's getting stranger and stranger.
It seems it only fails when the following combination of characters exists in the topic, áfter the youtube video javascript call: [space][singlequote].
So, " '" breaks it, but " [b][/b]'" doesn't brake it.
The first "Hier 'n nieuw" doesn't brake it, and neither does the "foto's" part.

I've quadruple checked the source, and I cannot find any javascript call that is using the topic-content.

<font color="" face="Tahoma, Arial, Sans Serif" size="2"><span class="spnMessageText" id="msg">
Hier 'n nieuw filmpje van ons supervlot, tijdens de vlottenrace van de Regio Weert, 
op vrijdagavond 23 mei jonstleden. <img src="images/PDT_Yellow_Sheika_03.gif" border="0" 
alt="" title="" ALIGN=ABSBOTTOM /><br />
<div class="tube">
<script language="javascript">EmbedYT("http://www.youtube.com/v/m5u6vUKf8KY",375,298,"false","high","white","white")
</script>
</div><div class="break">
</div>
<br />Voor de foto's <a href="http://www.scoutbytes.com/gallery/vrexprw08/index.html" target="_blank">klik hier</a>.
<br /><table border="1" cellpadding="10" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000">
<tr><td width="100%" bgcolor="#000000"><font color="beige"><span class="size1">
Het vorige bericht over de vlottenrace is door 'n onverlaat verwijderd, inclusief alle reacties.
</span class="size1"></font id="beige"></td></tr>
</table>
</div></span id="msg">

I do see I'm not closing the font tag....I'll check if that makes any difference.<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 09 June 2008 04:00:11
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 09 June 2008 :  04:47:36  Show Profile  Visit MarcelG's Homepage  Reply with Quote
I think I've found it ; I also parsed the topic content into the HTML keywords section....when I removed that part, the code worked, and the javascript error disappeared. <

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 09 June 2008 :  20:37:34  Show Profile  Reply with Quote
Possibly running code found from this blog / project before using it js side would remove the issue.

function addslashes( str ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Ates Goral (http://magnetiq.com)
    // +   improved by: marrtins
    // *     example 1: addslashes("kevin's birthday");
    // *     returns 1: "kevin\'s birthday"
 
    return str.replace('/(["\'\])/g', "\\$1").replace('/\0/g', "\\0");
}
<
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07