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

function not defined in Netscape 1

Status
Not open for further replies.

shmmeee

Programmer
Apr 17, 2001
104
GB
I'm testing a page in netscape which works perfectly in IE. When I call a function in an onClick I get a javascript error saying "get_defn is not defined", this only happens in Netscape can someone tell me what I'm doing wrong?
Here's the function that's called:
Code:
function get_defn(term_string)
{
	if(navigator.appVersion!="Netscape")
		IE_func(term_string);
        else{
		alert("Netscape");
                window.onerror = NSundefined_term;
		var defn_string = eval(term_string.replace(/ /g,"_").toUpperCase());
		defn_array = defn_string.split("=");
		document.form1.output.value = defn_array[0]; 
	}
}

And here's how it's called:
Code:
<input type=&quot;button&quot; name=&quot;B1&quot; value=&quot;Search!&quot; onclick=&quot;javascript:get_defn(document.form1.searchtext.value); write_link(); return false;&quot;>
 
I heard somewhere that NN has a problem with underscores in function (and possibly other) names. Try changing the function name to GetDefn and see if that works.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
That's worked. X-)
Wierd that, is it the same in NN6?
 
I don't know about NN6. I rarely use NN anyway, except to see how my page look in the &quot;other&quot; browser (and then I use NN4.7). I only found out about the underscore problem because one of the people from Tek-Tips sent me an email and mentioned it. I wish I could remember for sure who it was, I'd like to give him/her credit for a very useful piece of information. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top