Ajax和Mysql数据库第一次尝试不起作用 [英] Ajax and Mysql database first time try out not working

查看:73
本文介绍了Ajax和Mysql数据库第一次尝试不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨再次,


我第一次尝试这个Ajax数据库的东西而且它无法正常工作。

这是代码


这是testAjax.php

[HTML]<!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>

< meta http-equiv =" Content-Type"含量=" text / html的;字符集= ISO-8859-1" />

< title> Untitled Document< / title>

< script src =" file:../ testtextboxes.js"类型= QUOT;文本/ JavaScript的" language =" javascript">


< / script>

< / head>


< body>

< form>


输入您的徽章编号:

< input type =" text"名称= QUOT; badge_num"大小= QUOT; 20" onblur =" populate(this.value)" />

< br>名字:

< input type =" text" ID = QUOT;姓名"名称= QUOT;姓名" size =" 20" />

< / form>

< / body>

< / html>

[/ HTML]



这是testtextboxes.js

Hi again,

I tried this Ajax database thing for the first time and it is not working.
Here is the code

this is testAjax.php

[HTML]<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script src="file:../testtextboxes.js" type="text/javascript" language="javascript">

</script>
</head>

<body>
<form>

Type your Badge Number:
<input type="text" name="badge_num" size="20" onblur="populate(this.value)"/>
<br>First name:
<input type="text" id="firstname"name="firstname" size="20"/>
</form>
</body>
</html>
[/HTML]


This is testtextboxes.js

展开 | 选择 | Wrap | 行号

推荐答案

将xmlHttp声明为全局变量。
Declare xmlHttp as a global variable.




我确实将xmlHttp声明为我的js文件顶部的全局变量,如下所示


var xmlHttp


它仍然无法工作.....我不知道现在该做什么
Hi,
I did declare xmlHttp as a global variable to the top of my js file as follows

var xmlHttp

and it is still not working.....I dont know what to do now


嗨...

你可以试试


hi ...

may be you could try:

展开 | 选择 | Wrap | 行号


这篇关于Ajax和Mysql数据库第一次尝试不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆