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

onclick with hyperlink causes error

Status
Not open for further replies.

firsttube

Technical User
Apr 21, 2004
165
0
0
CA
I have an html hyperlink like this:
Code:
<a href="#" onclick="orderBy('ID');">ID</a>

right now the function is just this:
Code:
function orderBy(theField) {


}

When I click the hyperlink in IE I get this error:
Object doesn't support this property or method.

on the line with the hyperlink.

Why does this not work in IE?
Firefox is fine.


Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.
 
>When I click the hyperlink in IE I get this error:
>Object doesn't support this property or method.

Problem lies elsewhere.
 
i agree with tsuji, but as an aside: if you're trying to call a function without reloading the page, you should do this:

Code:
<a href="#" onclick="orderBy('ID'); return false;">ID</a>



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
tsuji is correct. Try that code in a new window, you will see that it does run in IE.

[monkey][snake] <.
 
actually, I changed the function name to "setOrderBy" and all is fine. Is orderBy a reserved word?


Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.
 
I'll make you a bet that you have an HTML element in your form by the name of orderBy.

[monkey][snake] <.
 
you win :)

Information is not Knowledge, Knowledge is not Wisdom, Wisdom is not Truth, Truth is not Beauty, Beauty is not Love, Love is not Music, Music is the best.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top