Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Javascript is driving me mad...

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
MarcelG Posted - 08 June 2008 : 15:07:02
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?<
6   L A T E S T    R E P L I E S    (Newest First)
phy1729 Posted - 09 June 2008 : 20:37:34
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");
}
<
MarcelG Posted - 09 June 2008 : 04:47:36
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. <
MarcelG Posted - 09 June 2008 : 03:55:21
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.<
phy1729 Posted - 08 June 2008 : 16:31:23
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.<
MarcelG Posted - 08 June 2008 : 15:49:23
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<
phy1729 Posted - 08 June 2008 : 15:46:46
try a \'<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.43 seconds. Powered By: Snitz Forums 2000 Version 3.4.07