Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Document vs Object HTMLDocument

Status
Not open for further replies.

pomt

Programmer
Nov 13, 2018
1
US
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;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top