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
Matched Pattern: "/\bsetTimeout\s*\(/"

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");}}
parent_window.setTimeout(function(parent){parent.WebRankV2.customize(1);},100,parent_window);return true;}

Recommended Answers

All 5 Replies

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.

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

Can you help solve my problem?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.