Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 6th, 2006, 07:27 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default error function not defined

Hi,

When I try the code from w3c:
http://www.w3schools.com/ajax/ajax_source.asp

It returns a error gethint is not defined.

Anyone knows why this is,

thnx

__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
  #2 (permalink)  
Old March 6th, 2006, 07:47 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I can't see any call to gethint, are you sure you copied the code correctly, it looks like the method is showHint().

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old March 6th, 2006, 09:05 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oops :s

I'm sorry about that.
I'm trying this ajax thing for hours so my eyes got a bit tired.
The exact error is in FireFox:
showHint is not defined.
In IE: object expected(I guess translated from dutch)

__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
  #4 (permalink)  
Old March 6th, 2006, 11:02 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Do you have the:
Code:
<script src="clienthint.js"></script>
in the page?
If so then the clienthint.js file is not being found in the same folder as the web page.
Can you show your actual HTML page?

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #5 (permalink)  
Old March 6th, 2006, 11:13 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the tag described as above

here is my page
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="clienthint.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form> 
First Name:
<input type="text" id="txt1"
onkeyup="showHint(this.value)">
</form>

<p>Suggestions: <span id="txtHint"></span></p> 
</body>
</html>
I also tried to put the code inside the script tags




__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
  #6 (permalink)  
Old March 6th, 2006, 11:53 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Go to your browser and type the address of the web page but replace the actual page name with "clientHint.js", if asked to open or save then save the file somewhere.


--

Joe (Microsoft MVP - XML)
Reply With Quote
  #7 (permalink)  
Old March 6th, 2006, 12:02 PM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thnx it works now

__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help : compile error : sub or function not defined Specialist VB How-To 2 June 20th, 2007 04:34 AM
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
User Defined Function niravp SQL Server 2000 7 November 29th, 2004 02:18 PM
Sub or Function Not Defined Olivia54 Access VBA 4 July 10th, 2004 01:56 PM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM



All times are GMT -4. The time now is 03:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.