Error loading page

Posted by blay on Stack Overflow See other posts from Stack Overflow or by blay
Published on 2013-11-04T09:43:01Z Indexed on 2013/11/04 9:54 UTC
Read the original article Hit count: 307

Filed under:
|

i have this script on my jquery mobile page that calls an insert script(untitled.asp) for data insertion, but when i press the submit buttom it tells me error loading page and it doesn't work

<!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>
   <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form action="" method="POST" name="form1" id="form1">
  <table width="327" border="0">
    <tr>
      <td width="88">Item</td>
      <td width="185"><label for="item_name"></label>
        <input type="text" name="item_name" id="item_name" /></td>
    </tr>
    <tr>
      <td>Quantity</td>
      <td><label for="quantity"></label>
        <input type="text" name="quantity" id="quantity" /></td>
    </tr>
    <tr>
      <td>Price</td>
      <td><label for="price"></label>
        <input type="text" name="price" id="price" /></td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;
        <input type="submit" value="Submit" /></td>
    </tr>
  </table>
</form>



   <script>
$(document).ready(function(){
    $("form").on('submit',function(event){
    event.preventDefault();

        data = $(this).serialize();

        $.ajax({
        type: "POST",
        url: "untitled.asp",
        data: data
        }).done(function( msg ) {
        alert( "Data Saved: " + msg );
        });
    });
});
</script>
</body>
</html>

it works fine on the website but when putting it into a mobile app it pops up this error enter image description here

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX