AJAX

Moderators: None (Apply to moderate this forum)
Number of threads: 60
Number of posts: 100

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Need your help(very simple) Posted by lawlawlaw on 9 Jul 2011 at 6:38 PM
I am an novice. In this case, i don't know why the value of
id "title" cannot pass to function,update. I need you


<html>
<head>
<script language="javascript">
function update(title,message){
var xmlHttp;
var url="process.php?Name="+title+"&Message="+message;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlHttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlHttp.onreadystatechange=function()
{
if (xmlHttp.readyState==4 && xmlHttp.status==200)
{
document.getElementById("txtUpdate").innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET",url,true);
xmlHttp.send();

}


</script>
<title>Main</title>
</head>

<body>
<form>
<table border=1>
<tr><td colspan=150><input type="text" value="input" id="title"></td><td colspan=5>num</td></tr>
<tr rowspan=30><td colspan=150><textarea rows="10" cols="40" id="message"> Put your Message Here!</textarea></td><td>

<input type="button" value="輸入" onclick="update(title.value,message.value)"><div id="txtUpdate"></div></td></tr>
</table>
</form>
</body>
</html>




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.