Forum Moderators: open
Errors
Line 141, character 106:
... /"+gDcsId+"/wtid.js"+"'></SCR"+"IPT>");
^Error: delimiter """ invalid: only s and tagc allowed here
Line 141, character 106:
... /"+gDcsId+"/wtid.js"+"'></SCR"+"IPT>");
^Error: end tag for element SCR which is not open; try removing the end tag or check for improper nesting of elements
I'm attempting to work with the new advanced JavaScript code for WebTrends On Demand. Why can't these people generate valid code? ;)
Fortunately for me, I don't have to deal with much JavaScript. But, when I do, there are common validation errors that I can normally correct myself, usually escaped ampersand issues.
I have no clue what may be happening above and below. I'm going to guess that I need to escape something in the string somewhere. Any help would be appreciated.
<script type="text/javascript"><!--
var gImages=new Array;
var gIndex=0;
var DCS=new Object();
var WT=new Object();
var DCSext=new Object(); var gDomain="statse.webtrendslive.com";
var gDcsId="removed"; if ((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)){
document.write("[b]<SCR"+"IPT[/b] Language='JavaScript' SRC='"+"http://"+gDomain+"/"+gDcsId+"/wtid.js"+"'>[b]</SCR"+"IPT>[/b]");
}
//-->
</script> Why would they break the word SCRIPT like that?
I always place <!-- on a new line for javascript.
You should use type="text/javascript" rather than language="javascript"
In this case, escaping / chars is complex. Because the strings are going to be written to the page, each / char probably needs to be escaped with three \ chars.
Thus I think "http://" must be written as "http:\\\/\\\/".
Perhaps only double-escaping is required - I was bug-hunting till 4am last night and my brain's only firing on two cylinders.
Kaled.
if ((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)){
document.write("<SCR"+"IPT Language='JavaScript' SRC='"+"http://"+gDomain+"/"+gDcsId+"/wtid.js"+"'><[b]\/SCR"+"IPT>[/b]");