We are having a problem with Javascript code being displayed on the user's screens.
We are using iPlanet version 4.1. as a web server.
When we first load our application and click on a page that uses a function to deal with rollovers generated by Dream Weaver,
instead of parsing the function correctly, it dispalys it on the screen.
It doesn't throw a Javascript error and nothing turns up in Debug.
If I reload the page the problem corrects itself and won't occur again during the session.
This didn't happen on Netscape Enterprise server and has only developed since we upgraded to iPlanet 4.1.
The functions are in a js file that is referenced at the beginning of the page.
If I clear my cache, I can replicate the problem.
I removed the code from the functions and the problem stopped except where the functions are explicitly defined in a page.
Then I run into the same problem.
The functios involved are as follows:
function MM_preloadImages() {
if (document.images) {
var imgFiles = MM_preloadImages.arguments;
var preloadArray = new Array();
for (var i=0; i<imgFiles.length; i++) {
preloadArray = new Image;
preloadArray.src = imgFiles;
}
}
}
function MM_swapImage() {
var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
(objStr.indexOf('document.all[') ==0 && document.all ==null))
objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
obj = eval(objStr);
if (obj != null) {
swapArray[j++] = obj;
swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src
ldArray[j];
obj.src = MM_swapImage.arguments[i+2];
}
}
document.MM_swapImgData = swapArray; //used for restore
}
function MM_swapImgRestore() { //v1.2
if (document.MM_swapImgData != null)
for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
document.MM_swapImgData.src = document.MM_swapImgData[i+1];
}
Has anybody run into this problem? Does anybody have any suggestions as to how to cure it?
My users are starting to get annoyed at having to always reload a page when garbage appears on the screen.
Thanks
Chris
We are using iPlanet version 4.1. as a web server.
When we first load our application and click on a page that uses a function to deal with rollovers generated by Dream Weaver,
instead of parsing the function correctly, it dispalys it on the screen.
It doesn't throw a Javascript error and nothing turns up in Debug.
If I reload the page the problem corrects itself and won't occur again during the session.
This didn't happen on Netscape Enterprise server and has only developed since we upgraded to iPlanet 4.1.
The functions are in a js file that is referenced at the beginning of the page.
If I clear my cache, I can replicate the problem.
I removed the code from the functions and the problem stopped except where the functions are explicitly defined in a page.
Then I run into the same problem.
The functios involved are as follows:
function MM_preloadImages() {
if (document.images) {
var imgFiles = MM_preloadImages.arguments;
var preloadArray = new Array();
for (var i=0; i<imgFiles.length; i++) {
preloadArray = new Image;
preloadArray.src = imgFiles;
}
}
}
function MM_swapImage() {
var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
(objStr.indexOf('document.all[') ==0 && document.all ==null))
objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
obj = eval(objStr);
if (obj != null) {
swapArray[j++] = obj;
swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src
obj.src = MM_swapImage.arguments[i+2];
}
}
document.MM_swapImgData = swapArray; //used for restore
}
function MM_swapImgRestore() { //v1.2
if (document.MM_swapImgData != null)
for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
document.MM_swapImgData.src = document.MM_swapImgData[i+1];
}
Has anybody run into this problem? Does anybody have any suggestions as to how to cure it?
My users are starting to get annoyed at having to always reload a page when garbage appears on the screen.
Thanks
Chris