我對此很陌生,無法弄清楚我出錯的地方。當我點擊按鈕時,什麼都沒有發生。我可能會增加太多額外的東西,我無法確定。任何幫助是極大的讚賞。我在這段代碼中遺漏了什麼?
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript" />
<html ng-app>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="victory.js"></script>
<script language="javascript" type="text/javascript">
var Walmart = (function() {
function Walmart(http, zone) {
this.stores = [];
this.storeid = document.getElementById("storenum").value
this.walmart = {
query: [
'http://search.mobile.walmart.com/search?query=',
'&store=' + this.storeid
],
};
this.zone = zone;
this.http = http;
console.log(this.walmart);
};
var query = document.getElementById("search").value;
Walmart.prototype.getWalmartStoreQuery = function (query) {
return this.http.get(this.walmart.store.query[0] + query + this.walmart.store.query[1]).map(function (res) { return res.json(); });
</script>
<tr>
<td><input type="text" name="storenum" id="storenum"></td>
<td><input type="text" name="search" id="search"></td>
</tr>
<tr>
<td><button onclick="getWalmartStoreQuery">Test</button></td>
</tr>
檢查控制檯是否有錯誤信息? –
自帶作爲一個錯誤的唯一的事情是「GET /favicon.ico」錯誤(404):「未找到」 – MrKane123
所以沒有錯誤消息,當您單擊該按鈕? –