0

Hey. I am new to webprogramming..so sorry if this question sounds stupid.
I use the function setTimeout() and document.all[id].style...etc to take the value I need
error:
Matched Pattern: "/\bsetTimeout\s*\(/"

else{parent_window=opener;}
parent_window.setTimeout(function(parent){parent.WebRankV2.customize(1);},100,parent_window);return true;}

my code is:

function customizeWebRank(){var parent_window=null;if(opener&&opener.location.href.indexOf("extensions.xul")!=-1){if(opener.opener&&(opener.opener.location.href.indexOf("browser.xul")!=-1)){parent_window=opener.opener;}
else{var window_service=Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);parent_window=window_service.getMostRecentWindow("navigator:browser");}}
else{parent_window=opener;}
parent_window.setTimeout(function(parent){parent.WebRankV2.customize(1);},100,parent_window);return true;}

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by Taywin
0

can u provide an example of what you are doing to call this function, it could be something in your html that is causing the error, also please use code tags, makes it easier to read code.

0

document.all[id].style is invalid in FF. There is no document.all in FF. Use document.getElementById(id) instead.

0

Sorry, you should do it yourself or you won't learn anything. You need to understand what the code does first. As I said before, you need to use document.getElementById(id) instead of document.all[id] in order to solve the cross-browser problem. Though, there may be others that I am not aware of. Try to get it work in one browser, and then work on another with a debugger (FF has firebug which is a good one). Search on the Internet for how different compared to the working browser using the hint you get from the debugger.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.