dcsimg
calling up a javascript inside a javascript
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Smith
Posted On:   Wednesday, June 16, 2004 07:07 AM

I have a script that detects browsers. It works well, however I want it to detect the browser then based on the browser detected process another javascript. here is the working syntax: if (navigator.appName == 'Netscape') location.href = 'netscape.html'; else { if (navigator.appName == 'Microsoft Internet Explorer') location.href = 'explorer.html'; else if (navigator.appName == '*') location.href = 'other.html'; } //--> ]]> ]]> This works to send to a web page but the location.href command doesnt work to call up a function like can someone please help?    More>>

I have a script that detects browsers. It works well, however I want it to detect the browser then based on the browser detected process another javascript.

here is the working syntax:



This works to send to a web page but the location.href command doesnt work to call up a function like



can someone please help?

   <<Less

Re: calling up a javascript inside a javascript

Posted By:   Sean_Owen  
Posted On:   Wednesday, June 16, 2004 09:17 AM

Are you trying to call a javascript function in script.js? Then just invoke the function name: "if (navigator.appName == 'Netscape') doSomething(); else ..."
About | Sitemap | Contact