[英]android phonegap database connection
我想使用此html并建立数据库连接以添加这些内容。 但是我真的不知道该用什么或怎么做。 你能帮助我吗?
<html>
<head>
<title>Ingredient</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="themes/receta.min.css" />
<link rel="stylesheet" href="themes/receta.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<script src="js/recetas.js"> </script>
</head>
<div>
<h1>RECETA</h1>
<label for="receta">Nombre Receta:</label><br>
<input type="text" name="receta" value="" maxlength="20" /><br>
</div>
<CENTER>
<body>
<label>Instrucciones</label>
<textarea style="width: 300px; height: 150px">
</textarea>
<label>Ingredientes</label>
<ul style="width: 300px; height: 150px">
<ul>
</ul>
<select onchange="selectIngredient(this);">
<option value="Cheese">Cheese</option>
<option value="Olives">Olives</option>
<option value="Pepperoni">Pepperoni</option>
<option value="Milk">Milk</option>
</select>
<li style="width: 300px; height: 150px">
<button>GUARDAR</button>
<li><a href="consultas.html" data-transition="none" rel="external">CONSULTAR</a></li>
</body>
</center>
</html>
这是我用来在html中列出列表的成分的功能:
function selectIngredient(select)
{
var $ul = $(select).closest('.ui-select').prev('ul');
console.log($ul[0])
if ($ul.find('input[value=' + $(select).val() + ']').length == 0) {
console.log('s')
$ul.append('<li onclick="$(this).remove();">' +
'<input type="hidden" name="ingredients[]" value="' +
$(select).val() + '" /> ' +
$(select).find('option:selected').text() + '</li>');
}
}
我可以放一张图片,但是我需要更多信誉,请帮助。
您不想从您的应用程序直接建立数据库连接。 如果能够这样做,则可能会将数据库连接凭据公开给全世界。 当然这是不可取的。
您需要做的是将Web服务放置到应用程序调用的位置。 然后,Web服务将进行数据库交互。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.