• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Why always show the javascript class AutoSuggestControl is not defined?

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why always show AutoSuggestControl is not defined?

I have a js file defined the class AutoSuggestControl
function AutoSuggestControl(oTextbox) {
...........
}

And the index.html included this file and new the object at onfocus event.

<script type="text/javascript" src="autosuggest.js"></script>

<input type="text" id="name" onfocus="new AutoSuggestControl(this)" />

But when the textbox is onfocus, a javascript error shows AutoSuggestControl not defined.
[ August 06, 2008: Message edited by: Calvin Wong ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you use a tool such as Firebug [firefox] or fiddler [ie] do you see the file being requested? Is the file in the same directory as the file you are requesting? If you type


into the address bar, does it say undefined?

Eric
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic