아래에 html 페이지가 있으며 드롭 다운에서 항목을 선택하면 기능이 실행됩니다. 함수를 밟고 라인에 도달 할 때마다
$("#ddlRoute").html(procemessage).show();
이 오류가 발생합니다. 잡히지 않은 typeerror : $ 함수가 아닙니다.
이게 뭔지 알아? 이 문제를 어떻게 해결합니까?
@using (Html.BeginForm())
{
<div id="RowOne-form">
<div class="section1">
<h2>Select a Customer</h2>
<div>
<label for="Branch">Branch:</label>
@Html.DropDownListFor(m => m.SelectedBranch, Model.BranchList, "Select Branch", new { @id = "ddlBranch", @style = "width:200px;", @onchange = "javascript:GetRoute(this.value);" })
</div>
<div>
<label>Route:</label>
<select id="ddlRoute" name="ddlRoute" style="width: 200px"></select>
</div>
</div>
<hr />
<div class="form-Buttons-Sec" style="margin:35px;">
<input id="Save1" type="button" value="Save"/>
<input id="Cancel1" type="button" value="Cancel" />
</div>
}
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script language="javascript" type="text/javascript">
function GetRoute(_branchId) {
var procemessage = "<option value='0'> Please wait...</option>";
$("#ddlRoute").html(procemessage).show();
var url = "/Home/GetRouteByBranchId/";
$.ajax({
url: url,
data: { branchId: _branchId },
cache: false,
type: "POST",
success: function (data) {
var markup = "<option value='0'>Select City</option>";
for (var x = 0; x < data.length; x++) {
markup += "<option value=" + data[x].Value + ">" + data[x].Text + "</option>";
}
$("#ddlRoute").html(markup).show();
},
error: function (reponse) {
alert("error : " + reponse);
}
});
}
</script>
jQuery에 대한 참조를 얻기 위해 사용하는 URL이 잘못된 것 같습니다. 대신 이것을 사용해보십시오 ...
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다