我想使用phonegap提交一个应用程序,我的应用程序使用了很多我知道苹果不太喜欢的php,只是拒绝了该应用程序并说最好有一个网络应用程序。我在这里有一个示例 index.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>
</title>
<link rel="stylesheet" href="css/logout-button.min.css" />
<link rel="stylesheet" href="css/jquery.mobile-1.3.0.min.css" />
<link rel="stylesheet" href="css/my.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</script>
<script src="js/jquery.mobile-1.3.0.min.js"></script>
<script src="js/jquery.cookies.2.2.0.min.js"></script>
<script type="text/javascript">
var uid = $.cookies.get( 'uid' );
if(uid == null)
{
window.location ='account-login.html'; }
else
{ }
</script>
</head>
<body>
<div data-role="page" id="index4">
<div data-theme="a" data-role="header">
<a data-role="button" data-direction="reverse" data-rel="back" data-transition="slide"
data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
Back
</a>
<h3>
Event Details
</h3>
</div>
<div data-role="content">
<form id="eventForm" name="eventForm">
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="event">
Event
</label>
<input name="eventname" id="eventname" placeholder="eventname" value="" type="text" />
</fieldset>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="about">
About
</label>
<textarea name="about" id="about" placeholder="about" value=""></textarea>
</fieldset>
</div>
<div data-role="fieldcontain">
<label for="dates">
Choose Dates
</label>
<div id="with-altField"></div>
<input type="hidden" id="altField" name="dates">
</fieldset>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="enddate">
End Date
</label>
<div id="with-altfield1"></div>
<input type="hidden" id="altField1" name="enddate">
</fieldset>
</div>
<div data-role="fieldcontain">
<script>
$.get('event-details.php', function(data){
$('#yourdiv').html(data);
});
</script>
<div id="yourdiv"></div>
</div>
<div data-role="fieldcontain">
<label for="manual">Add Emails</label>
<textarea cols="40" rows="8" name="emails" id="emails"></textarea>
</div>
<input type="submit" value="Submit" id="submitEventButton">
</form>
</div>
</div>
</body>
</html>
我在这里调用 event-details.php
<?
require_once("../backend/functions.php");
dbconn();
$id = $CURUSER["id"];
$res = "SELECT username,email,status FROM users left join cal_contacts on cal_contacts.contactid = users.id WHERE cal_contacts.userid = $id";
$res1 = mysql_query($res);
?>
<label for="select-choice-1" class="select">
Choose Contacts:
</label>
<select name="contacts[]" id="contacts" multiple="multiple" data-native-menu="false">
<?
while($row = mysql_fetch_array($res1))
{
print "<option value=$row[email]>$row[email] ($row[status])</option>";
}
?>
</select>
<?
我有通过 php 创建的选择菜单。我想知道是否有另一种方法可以做到这一点,所以完整的选择 html 不必在 php 脚本上。这意味着一旦提交,我将更难更改我的应用程序,我相信苹果会更容易接受它。