Forum Moderators: open
I have been observing huge number of 404 error messages in the logs of the web server which redirects requests to the application server.
The error message is for the http request to an incomplete URL which is something like [<server-name>...] The resource name for which the request is issued is not present and so it throws a 404 error.
The same error could be observed in a standalone application using tools like HTTPAnalyser and HTTPWatch.
On initial analysis it was found that the http request was fired from one of the functions in the HTC files which does the clean up of the menu items.
On putting some alerts and using the HTTPWatch tool it was observed that the below line of code is the one which fires the HTTP request to a non-existent resource.
Below is the HTTPWatch Log..
+ 2.8400.014392284GET404text/html;charset=ISO-8859-1http://localhost/ContextRoot/ModuleWeb/desktop/
********
if (d.body && d.body.parentElement)
{
d.body.parentElement.removeNode(true);
}
where var d = oMenu.popup.document;
********
Can some one please tell me why do i have a HTTP request fired whenever removeNode() is called? Has any body else seen such behavior before? If yes, then let me know if you found any solution for this.
Cheers
if (oMenu.popup) {
var d = oMenu.popup.document;
if (d) {
d.me = null;
d.onmouseover = "";
d.onmouseout = "";
d.onmouseup = "";
d.onmousewheel = "";
d.onkeydown = "";
d.oncontextmenu = "";
var ss = d.styleSheets;
var l;
if (ss) {
l = ss.length;
// Loop for every style sheet
for (i = 0; i < l; i++)
ss[i].href = "";
}
ss = null;
if (d.body && d.body.parentElement) {
d.body.parentElement.removeNode(true);
}
d.open( "text/html", "replace" );
d.write( "" );
d.close();
}
d = null;
}
oMenu.popup = null;
Rambo,
There is no form involved. It just a HTML menu generated from the XML. I am not sure from where the URL gets generated. Another observation that i had is if I comment out "d.body.parentElement.removeNode(true);" or set the boolean value to 'false' in removeNode(), then i dont get the HTTP request and hence the 404 error.
It looks like while removing the child nodes, the request is fired but i am not able to get the element for which this happens.
Is there any way I can iterate the child nodes of "d.body.parentElemt" and debug the issue? I tried using alerts but it always displays [Object] in the pop up.. Is there any function which gives me the tag name of the element?
Thanks all for your help.