• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic