I set up a simple website using ajax framework. The code of html page is as below:
When I click button after running from Visual Studio 2005, I get error called "callback is undefined."Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Getting XML with ReadXmlWithGet</title> <script type="text/javascript" src="ajaxframework.js" /> <script type="text/javascript" > function callback(xml) { xmlData = xml.getElementByTagName("data"); document.getElementById("targetDiv").innerHTML = xmlData(0).firstChild.data; } </script> </head> <body> <h1>Getting XML with ReadXmlWithGet </h1> <form> <input onclick="readXmlWithGet('data.xml', callback)" type="button" value="Display Msg 1" /> </form> <div id="targetDiv" height="100" width="100">The fetched data will appear here. </div> </body> </html>
I am new to this. Anybody could tell me why?


Reply With Quote
Bookmarks