When I post an entry, EE is converting square brackets [..] characters to angle brackets <..>, which of course breaks the Javascript. When I can save the entry and reopen it, the [] are still there; however, when it viewed the source of the served page in a browser, it is <>
Here is the code where it happens
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i];
var fileref="";
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
The fifth line down
var file=arguments[i];
becomes
var file=arguments<i>;
I found a work-around by changing the code to
var file=arguments[i+0];
Note that there are other [] in code that are not getting converted
function swap(_name, _src) { document.images[_name].src = _src; }
Thanks
