php - jquery mobile is ruining my POST -


i have html file (index.html) containing head section , body section. in body section have form post action pointing php file.

if add head section cdn of jquerymobile... post stops working. how possible, , how avoid this?

so head looks this:

<head>     <title>my mobile app</title>     <meta charset="utf-8" />     <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1" />     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">     <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>     <script type="text/javascript" src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>     <meta name="apple-mobile-web-app-capable" content="yes" />     <meta name="apple-mobile-web-app-status-bar-style" content="black" />     <link rel="apple-touch-icon" href="images/icon57.png" />     <link rel="apple-touch-icon" sizes="72x72" href="images/icon72.png" />     <link rel="apple-touch-icon" sizes="114x114" href="images/icon114.png" />     <link rel="apple-touch-startup-image" href="images/icon320.png" />     <link rel="apple-touch-startup-image" sizes="768x1004" href="images/icon320.png" /> </head>  ** if comment jquery.mobile script line post works ** 

and body post looks this:

<body>     <div data-role="page" id="index">                 <header data-role="header" data-position="fixed">                     <h1>mobile app</h1>                 </header>                 <div data-role="content">                     <b>login</b>                     <form method="post" action="prologin.php">                         name: <input type="text" name="name"><br>                         password: <input type="password" name="pass"><br>                         <input type="submit" value="login" data-inline="true" data-icon="gear">                     </form>                 </div>                  <footer data-role="footer" data-position="fixed">                     <h1>bla bla</h1>                 </footer>     </div> </body> 

now php file prologin.php more complicated debugging purposes reduced to:

<?php echo 'name='.$_post['name'].' , pass='.$_post['pass']; ?> 

so, when use jquery.mobile scripts, result of clicking login button undefined page if view page source... it's empty, mean looks :

name= , pass= 

, nothing posted if comment script line jquery.mobile, result shows should, mean:

name=myusername , pass=mypassword 

(of course myusername , mypassword values enter in input boxes) doing wrong?

this same pages , code worked fine on server. not work anymore. wrong? original host centos system, same configuration mostly. on working server had php version 5.3.3 , on 1 (not working) have php version 5.1.6 how can using jquery mobile affect html post in such way stop working?

i mean, how can fix it?

i try update php on server there other apps rely on version , avoid updating.

just add attribute form:

data-ajax="false" 

it prevent jquery mobile hijacking form submit logic.

your form should this:

<form method="post" action="prologin.php" data-ajax="false"> 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -