我有一个简单的html登录表单,使用phonegap框架部署在Xcode上。
当单击submitLogin按钮时,我使用ajax请求发送登录凭据以验证登录。这是我用来处理登录的javascript函数:
function submitLoginForm (login_id, login_pass){
//here we need to communicate with the php files in the server
console.log ("debug 1 ");
$.ajax({
type: "POST",
我有一个非常简单的Javascript函数(我没有使用jQuery),它使用<script>标记在html中工作,但是当我将它放在一个单独的.js文件中时,它不能工作。我知道我做错了什么,这可能只是一个简单的修复,但我不能弄清楚。有什么帮助吗?非常感谢!
下面是我的js:
function create() {
var htmlElements = "";
for (var i = 0; i < 5; i++) {
htmlElements += '<div class="box">' + i + &