亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么不能顯示出來效果

<!DOCTYPE?html>
<html>
<head>
<meta?charset="utf-8">
<link?rel="stylesheet"?type="text/css"?href="static\assets\global\plugins\bootstrap\css\bootstrap.min.css">
<link?rel="stylesheet"?type="text/css"?href="static\assets\global\css\components.css">
<link?rel="stylesheet"?type="text/css"?href="static\assets\admin\pages\css\login.css">
<script?src?=?"static\assets\global\plugins\jquery-1.11.0.min.js"?type="text/javascript"></script>
</head>
<body>
<div?class="content">
<h3?class="form-title">商品列表瀏覽</h3>
<div?class="table-responsive">
<table?class="table">
<div>
<thead>
<tr>
<th>商品名</th>
<th>商品圖片</th>
<th>商品描述</th>
<th>商品價格</th>
<th>商品庫存</th>
<th>商品銷量</th>
</tr>
</thead>
<tbody?id?=?"container">
</tbody>
</div>
</table>
</div>
</div>
</body>
<script>
//定義全局商品信息
var?g_itermLsit?=?[];
jQuery(document).ready(function(){
$.ajax({
type:"GET",
url:"http://localhost:8002/iterm/list",
xhrFields:{withCredentials:true},
success:function(data){
if(data.status?==?"success"){
g_itermLsit?=??data.data;
reloadDom();
}else{
alert("獲取商品信息失敗,原因為"+data.data.errMsg);
}
},
error:function(data){
alert("獲取商品信息失敗,原因為"+data.responseText);
}
});
});
function?reloadDom(){
for(var?i?=?0;i<g_itermLsit.length;i++){
var?itermVO?=?g_itermLsit[i];
var??dom?=?"<tr><td>"+itermVO.title+"</td><td><img?src='"+itermVO.imUrl+"'/></td><td>"+itermVO.description+"</td><td>"+itermVO.price+"</td><td>"+itermVO.stock+"</td><td>"+itermVO.sales+"</td>"+"</tr>"
$("container").append($(dom));
}
}
</script>
</html>

https://img1.sycdn.imooc.com//5ca2269e0001a45b04450047.jpg

后端沒有問題


正在回答

3 回答

container 前面加上 #,?

$("#container").append($(dom));


0 回復 有任何疑惑可以回復我~

我也是你這個問題,把dom后邊的東西都放在同一行就好了!還有:你最后的container前邊少個 #

0 回復 有任何疑惑可以回復我~

項目我沒有跟著敲,光是看頁面不太知道是什么問題,感覺這種文件找不到的,一般都是絕對路徑,相對路徑沒有引對的問題,如果你解決了,麻煩你也回復我一個,讓我也學習一下。

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么不能顯示出來效果

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號