0
JQMを初めて使用しています。私は外部のJavaスクリプト関数をhtmlから呼び出す必要があります。これのために、私はこのような頭のタグに外部のjavascriptファイルを含めています。Jquery-Mobile:htmlから外部Javaスクリプト関数を呼び出す方法
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Single page template</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" type="text/css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="food_exercise.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
私はこのような外部JS関数を呼び出しています。ここで私はこのようなエラーを取得していますsciptタグの無効な場所。選択タグのデータを変更するときに外部JS関数を呼び出す方法は?誰もがあなたがSmamattiによってmetionedとして、無効な場所にスクリプトタグを入れていないのに注意する必要があり、私
<div data-role="content">
<div>
<select onchange="set_FRE(this,Item_Activity,Qty_Time)" size="1" name="choice">
<option value="" selected="selected">SELECT Food/Exercise</option>
<script type="text/javascript">
setChoice(this);
</script>
</select>
<select name="Item_Activity" size="1" disabled="disabled" onchange="set_item_activity(this,Qty_Time)"></select>
<select name="Qty_Time" size="1" disabled="disabled" onchange="print_IE_QT(Item_Activity,this)"></select>
</div>
</div>
'script'タグを' select'タグの中に入れてはいけません。それをheadやbody(おそらく 'pagebeforecreate'のようなJQMイベント)で定義し、それを_onclick_、_onchange_など必要なものと呼んでください。 – Smamatti