<script type="text/javascript">
var xmlHttp;
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox,chrome,Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function go(names){
var xmlHttp=GetXmlHttpObject(); //创建浏览器对象
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="<?=site_url()?>/login/ajax";//主要是这个路径问题
//var url="http:localhost/CodeIgniter/index.php/login/ajax 绝对路径也不行
url=url+"?user="+names;
xmlHttp.open("Get",url,true);
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4 ) {
document.getElementById("result").innerHTML = xmlHttp.responseText;
}
}
xmlHttp.send(null);
}
</script>
</head>
<body>
<h2><?php echo $frist ?></h2>
<div style="color: red;"><?php if(isset($error)) echo $error;?></div>
<form action="zhi" method="post" enctype="multipart/form-data" >
<table>
<tr>
<td>用户名:</td>
<td><input type="text" name="user" value="<?php echo set_value('user')?>" size="20" onblur="go(this.value)" /><?php echo form_error('user')?></td>
<td><div style="color: red;" id="result">11</div> </td>
</tr>
<tr>
<td>密 码:</td><td><input type="password" name="password" size="20" /><?php echo form_error('password')?></td>
</tr>
<tr>
<td>确认密 码:</td><td><input type="password" name="password2" size="20" /><?php echo form_error('password2')?></td>
</tr>
<tr>
<td><input type=submit value="注册"/></td>
</tr>
</table>
</form>
</body>
</html>
总是报那个路径找不到,不知道什么原因写绝对路径也不行,也是一样的报警?404 Page Not Found
The page you requested was not found. |