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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript in IE and Firefox

Status
Not open for further replies.

jimmyweb

Programmer
Dec 9, 2004
37
US
Hi friends,
I have an application with DHTNL and JavaScript. it works well in IE. But it does not work in firefox and Netscape.
I got error message as:
Error: newStyleSheet.sheet has no properties
Source File: Line: 917
The IE syntax as********
newStyleSheet.addRule(MTMstyleRules.rules.selector, MTMstyleRules.rules.style);
The firefox and netscapt as*******
newStyleSheet.sheet.insertRule((MTMstyleRules.rules.selector + " { " + MTMstyleRules.rules.style + " } "), newStyleSheet.sheet.cssRules.length);


How to recode SYntax to match firefox requirement?
MTMstyleRuleSet is a function
newStyleSheet = MTMUA.document.styleSheets(MTMUA.document.styleSheets.length-1);
 
Welcome to hell. You need a browser detection script that does something like setting a variable called "browser" and then statements like if(browser=="Firefox"){ .. } else if(browser=="IEWin") { .. } etc..
 
Hi SIlverspecv,
Thanks for your email.
I done this way. but modified cod e does not working in forefox. see code is both IE and Firefox

The IE syntax as********
newStyleSheet.addRule(MTMstyleRules.rules.selector, MTMstyleRules.rules.style);

The firefox and netscapt as*******
newStyleSheet.sheet.insertRule((MTMstyleRules.rules.selector + " { " + MTMstyleRules.rules.style + " } "), newStyleSheet.sheet.cssRules.length);


How to recode SYntax to match firefox requirement?
MTMstyleRuleSet is a function
newStyleSheet = MTMUA.document.styleSheets(MTMUA.document.styleSheets.length-1);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top