我正在创建一个应用程序并且我有一个索引。我怎样才能进入我的其他屏幕以便它也可以工作? 我的另一个屏幕在ingredientes.html但是当它改变屏幕时,我的其他屏幕中的过程不起作用。但是,当我单独打开另一个屏幕时,它可以工作。所以我不知道问题是什么。
<!DOCTYPE html>
<html>
<head>
<title>Receta</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="css/jquery.mobile.structure-1.1.0.min.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/cordova-1.8.1.js"></script>
<script type="text/javascript" charset="utf-8" src="js/cuenta.js"></script>
</head>
<h1><center>RECETA</h1>
<!DOCTYPE html>
<body>
<button onclick="myFunction('Persona','Recetario')">Bienvenido</button>
<script>
function myFunction(name,job)
{
alert("Bienvenida " + name + ", puede comenzar a crear su " + job);
}
</script>
</body>
<form action="/html/tags/html_form_tag_action.cfm" method="get">
<fieldset>
<legend>Detalles</legend>
<div>
<label for="receta">Nombre Receta:</label><br>
<input type="text" name="receta" value="" maxlength="20" /><br>
</div>
</fieldset>
</form>
</html>
--------------------------------------------------
<!DOCTYPE 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><body>
<h1>INGREDIENTES</h1>
<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>
</body>
</html>
(recetas.js)
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>');
}
}