Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2006, 07:27 AM
Friend of Wrox
 
Join Date: Nov 2005
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
 
Old March 6th, 2006, 07:47 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old March 6th, 2006, 09:05 AM
Friend of Wrox
 
Join Date: Nov 2005
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
 
Old March 6th, 2006, 11:02 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old March 6th, 2006, 11:13 AM
Friend of Wrox
 
Join Date: Nov 2005
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
 
Old March 6th, 2006, 11:53 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old March 6th, 2006, 12:02 PM
Friend of Wrox
 
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thnx it works now

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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.