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!

Problem in rendering .js file in Netscape

Status
Not open for further replies.

RakhiKalra

Programmer
Jun 6, 2003
41
IN
Hi,

I have made a form on which some validation functions are present in a .js file which is included in my form page as follows:


<script language="javascript" src="commonFunctions.js"></script>


The form works fine in IE but as i see the page on Netscape, the error comes : TrimString is not defined.

i came to this conclusion that Netscape is not able to render the .js file thats why the funtion - TrimString could not b found.

Pls help

Rakhi
 
This is not a Netscape problem! First, you're external file declaration is incorrect. It should look like this: <script src="commonFunctions.js" type="text/javascript"></script>. Second, it looks like TrimString is a variable that is being used but not being declared/initialized or a function parameter that is not being passed with a value.



There's always a better way. The fun is trying to find it!
 
tviman,

I have already tried this- <script src="commonFunctions.js" type="text/javascript"></script>. but no avail.

TrimString is a function defined in the CommonFunctions.js



Rakhi
 

There must be a reason why it is working in one browser and not in the other. Can you tell us what version of NN it is not working in? v4? v6? v7+? Have you tried running the JS console in NN and seeing what errors appear?

Failing that, how about you help us to help you and actually give us some source to look at?

Dan
 
Hello RakhiKalra,

For the most simple testing config for local in the same folder of the htm, try this:
[tt] <script language="javascript" src="[red]./[/red]commonFunctions.js"></script>[/tt]

For the same system with absolute path, use file:// protocol:
[tt] <script language="javascript" src="[red]file:///d:/test/[/red]commonFunctions.js"></script>[/tt]

If it is using http:// protocol out there in the wild, point it to the url. In all these cases, it would be ie and nn compatible.

regards - tsuji
 
Maybe if you posted a link to the code we could provide more help?

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top