获取用json加载的内容

时间:2015-03-02 02:15:37

标签: javascript jquery html json

安装了shopify(qucik view)的应用程序,该应用程序在弹出窗口中显示产品。看起来所有的内容和数据都加载到具有特定id的div中,而json是一个类。我试图用jquery来拉动和编辑它的某些部分(比如hrefs),但是没有运气。我是js的新手,所以看起来有些东西我不知道。

尝试使用标准jquery行

$(".sca-qv-showqv").each(function(){
   var ttlhref = $(this).find("#sca-qv-detail").attr("href");
   $(this).find("a.sca-qv-title").attr("href",ttlhref);
});

我的猜测是它试图在所有数据加载之前提取数据。我也试过窗口加载,没有运气。来自控制台的错误:

Uncaught Error: Syntax error, unrecognized expression: .main-nav ul li ul. .superimage img
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:4 load jquery 1.11
jquery.js:9592 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 collection_handle : undefined
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 Disable QV : 
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 image_zoom_type : original
sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 image_show_type : large
foundation.min.map:1 GET http://cdn.shopify.com/s/files/1/0519/3185/t/10/assets/foundation.min.map 404 (Not Found)
app.css.map:1 GET http://cdn.shopify.com/s/files/1/0519/3185/t/10/assets/app.css.map 404 (Not Found)

0 个答案:

没有答案