我正在使用 phonegap 并且每次它在这一行给我错误。我试图通过 phonegap 提交表单,javascript 工作但使用 jquery 它总是我这个错误未捕获的 ReferenceError: jQuery is not defined at file
jQuery(function() {
这是我的代码
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js">
</script>
<script type="text/javascript" src="jquery-1.6.4.min.js"></script>
<script>
function validation()
{
alert('validation');
}
jQuery(function() {
alert("login");
/* stop form from submitting normally */
event.preventDefault();
/*clear result div*/
/* get some values from elements on the page: */
//var values = $(this).serialize();
var values = "user";
/* Send the data using post and put the results in a div */
jQuery.ajax({
url: server_url,
type: "post",
data: values,
success: function() {
alert("success");
jQuery("#result").html('submitted successfully');
},
error: function() {
alert("failure");
jQuery("#result").html('there is error while submit');
}
});
});
</script>
</head>