Jquery無法在Internet Explorer上工作。然而它運行在其他網頁瀏覽器上。 這是我寫的代碼是在Internet Explorer上使用jquery問題
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#myform").validate({
debug: false,
rules: {
name: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "A valid email will help us get in touch with you.",
},
submitHandler: function(form)
{
$.post('process.php', $("#myform").serialize(), function(data)
{
$('#results').html(data);
});
}
});
});
</script>
</head>
<body>
<form name="myform" id="myform" action="" method="POST">
<label for="name" id="name_label">Name</label>
<input type="text" name="name" id="name" size="30" value=""/>
<br>
<label for="email" id="email_label">Email</label>
<input type="text" name="email" id="email" size="30" value=""/>
<br>
<input type="submit" name="submit" value="Submit">
</form>
<div id="results"><div>
</body>
</html>
process.php
<?php
print "Form submitted successfully: <br>Your name is <b>".$_POST['name']."</b> and your email is <b>".$_POST['email']."</b><br>";
?>
如何運行的Internet Explorer。任何幫助,這個代碼在此
您是否收到JavaScript控制檯的錯誤消息?你使用的是什麼版本的IE?我們是開發者,也不是魔術師:) – Devraj 2012-07-05 09:45:31
沒有錯誤。當我點擊提交按鈕時,我再次獲得相同的頁面詢問姓名和電子郵件 – jat 2012-07-05 09:47:12