Hello,
I have a ColdFusion application calling a javascript function. The application works in the production environment but for some reason, it does not work in the test environment. I debugged line by line the javascript function that is being called and I found out that the function in production is returning an [object document] while in the test environment is returning an [object HTMLDocument]. Does anyone have a clue how this could happen?
Here's the js function:
function btnSubmit(loc,action,target,refParent){
alert('btnSubmit loc is '+loc);
//alert('btnSubmit action is ' + action);
alert('btnSubmit target is ' + target);
alert('btnSubmit refParent is ' + refParent);
if(refParent == true){
root = parent.document;
}
else{
alert('refparent is not true then goes here');
root = document;
}
alert('btnSubmit root is ' + root) --root is an [object document] in PROD
if(action == "submit" && target){
alert('btnSubmit action && target is ' + action);
alert(root.getElementById(target).name);
alert('loc=' + loc);
root.getElementById(target).action = loc;
alert(root.getElementById(target).action);
alert('before submit');
alert(root.getElementById(target).submit());
root.getElementById(target).submit();
}
else if(target){alert('else if target source is loc');alert('loc is ' + loc);
root.getElementById(target).src = loc;
}
else{alert('else location href is loc ' + loc);
root.location.href = loc;
}
}
I have a ColdFusion application calling a javascript function. The application works in the production environment but for some reason, it does not work in the test environment. I debugged line by line the javascript function that is being called and I found out that the function in production is returning an [object document] while in the test environment is returning an [object HTMLDocument]. Does anyone have a clue how this could happen?
Here's the js function:
function btnSubmit(loc,action,target,refParent){
alert('btnSubmit loc is '+loc);
//alert('btnSubmit action is ' + action);
alert('btnSubmit target is ' + target);
alert('btnSubmit refParent is ' + refParent);
if(refParent == true){
root = parent.document;
}
else{
alert('refparent is not true then goes here');
root = document;
}
alert('btnSubmit root is ' + root) --root is an [object document] in PROD
if(action == "submit" && target){
alert('btnSubmit action && target is ' + action);
alert(root.getElementById(target).name);
alert('loc=' + loc);
root.getElementById(target).action = loc;
alert(root.getElementById(target).action);
alert('before submit');
alert(root.getElementById(target).submit());
root.getElementById(target).submit();
}
else if(target){alert('else if target source is loc');alert('loc is ' + loc);
root.getElementById(target).src = loc;
}
else{alert('else location href is loc ' + loc);
root.location.href = loc;
}
}