(function($){$.each(data, function(i, n) 这个函数不执行,该怎么修改呢?
mui.ajax({
type:'GET',
dataType:'json',
data:{},
url :'http://www.xinfagc.com:8080/marketitem',
success :function(goods){
goods = JSON.stringify(goods);
var data = goods;
(function($){$.each(data, function(i, n){
var li = document.createElement('li');
li.className = 'mui-table-view-cell';
li.innerHTML = '<img class="mui-media-object mui-pull-left" src="../img/goods/4_04783628068422293_60.jpg"><div class="mui-media-body"><p class="mui-ellipsis3">'+n[i].goods_name+'</p><p class="mui-ellipsis">佣金: ¥'+n[i].goods_comm_fixed+'</p><p class="mui-ellipsis2">现价:¥'+n[i].goods_price+'</p></div><div class="mui-button-dis"><button class="dis-button1">查看详情</button><button class="dis-button2">我要分销</button></div>';
table.appendChild(li);
})(mui);
})
}
});
jie (作者)
谢谢,我把 (function($) 去掉了,添加了一个 <script src="../js/jquery-1.8.0.js"></script> 文件,就好了
2015-03-10 13:33