我通過適配器獲取JSON響應。如何將其填充到下拉列表中。我嘗試將php代碼插入到我的HTML代碼中。但它是打印itselp的代碼。從適配器填充JSON響應到下拉菜單
HTML Code:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>TestApp</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="stylesheet" href="css/TestApp.css">
<script>window.$ = window.jQuery = WLJQ;</script>
</head>
<body id="content" style="display: none;">
<!--application UI goes here-->
SOWRUN APP</br>
<p> employeenumber: <input type="text" id="employeenumber"/></br>
<p><br>employeename: <input type="text" id="employeename"/></br></p>
<p><br>employeeemail: <input type="text" id="employeeemail"/></br></p>
<p><br>employeeadID: <input type="text" id="employeeadID"/></br></p>
<p><br>businessUnit: <input type="text" id="businessUnit"/></br></p>
<select name="country" id="country">
<option>Select Country</option>
<option>INDIA</option>
<option>USA</option>
</select>
<p><br>city: <input type="text" id="city"/> </br></p>
<p><br>location: <input type="text" id="location"/>
<p><br>bloodGroup: <input type="text" id="bloodGroup"/>
<p><br>gender: <input type="text" id="gender"/></br></p>
<p><br>tShirt: <input type="text" id="tShirt"/>
<input type="button" onclick="submitName()" value="Submit"/></br>
<script src="js/initOptions.js"></script>
<script src="js/TestApp.js"></script>
<script src="js/messages.js"></script>
</body>
</html>
我想有填充入我從適配器獲得「國家」下拉列表中的以下JSON響應。
JSON響應:
{
"array": [
{
"con_name": "India"
},
{
"con_name": "Portugal"
},
{
"con_name": "Spain"
},
{
"con_name": "UAE"
},
{
"con_name": "USA"
},
{
"con_name": "Mexico"
},
{
"con_name": "Australia"
},
{
"con_name": "Romania"
},
{
"con_name": "Phillipines"
},
{
"con_name": "Netherlands"
},
{
"con_name": "UK"
},
{
"con_name": "Singapore"
},
{
"con_name": "Switzerland"
},
{
"con_name": "Hungary"
},
{
"con_name": "USAWest"
},
{
"con_name": "USA South"
},
{
"con_name": "Mexico"
},
{
"con_name": "Brazil"
},
{
"con_name": "China"
},
{
"con_name": "NewZealand"
},
{
"con_name": "Poland"
},
{
"con_name": "Japan"
},
{
"con_name": "Germany"
},
{
"con_name": "Canada"
},
{
"con_name": "France"
},
{
"reg_AD_ID": "111111"
}
],
"isSuccessful": true,
"responseHeaders": {
"Connection": "Keep-Alive",
"Content-Length": "594",
"Content-Type": "text\/html",
"Date": "Mon, 29 Jul 2013 07:01:37 GMT",
"Keep-Alive": "timeout=5, max=100",
"Server": "Apache\/2.2.21 (Win32) PHP\/5.3.8",
"X-Powered-By": "PHP\/5.3.8"
},
"responseTime": 85,
"statusCode": 200,
"statusReason": "OK",
"totalTime": 85
}
請建議我如何去了解它。 – Sadanand