Jquery plugins 用于弹出页面的statcounter自定义标记
我的网页上有一个产品列表,其详细信息显示在模式弹出窗口中。 我尝试使用他们网站[上显示的statcounter的自定义标记,但它仅适用于一个产品类别。我使用相同的模态体来显示不同的产品。 以下是代码片段:Jquery plugins 用于弹出页面的statcounter自定义标记,jquery-plugins,modal-dialog,analytics,Jquery Plugins,Modal Dialog,Analytics,我的网页上有一个产品列表,其详细信息显示在模式弹出窗口中。 我尝试使用他们网站[上显示的statcounter的自定义标记,但它仅适用于一个产品类别。我使用相同的模态体来显示不同的产品。 以下是代码片段: var sc_project = $#@$#@; var sc_invisible = 0; var sc_security = "$#*$*##$"; var _statcounter = _statcounter || []; //function to
var sc_project = $#@$#@;
var sc_invisible = 0;
var sc_security = "$#*$*##$";
var _statcounter = _statcounter || [];
//function to push custom statcounter for products_of_interest
function _productStatCounter(product_of_interest) {
_statcounter.push({ "tags": { "data-project": product_of_interest } });
}
// jquery to push projects based on click
$(".portfolio-link").click(function () {
test_product = ($(this).attr("href"));
if(test_product !== undefined){
product_of_interest = ($(this).attr("data-project"));
_productStatCounter(product_of_interest);
} else {
return;
}
});
我使用jquery在点击产品的基础上推送感兴趣的产品,但是statcounter只显示一个产品的信息,而不是所有产品的信息。由于我的产品web应用程序是一个单独的页面,所以我使用modal body在弹出屏幕上显示不同的产品。有没有办法在弹出窗口上使用statcounter?最终我找到了解决方案。这是我用来实现目标的一个“技巧”。解决方案是这样的。首先,我制作了一个单独的Html页面,其中包含StatCounter代码,然后在弹出窗口中使用Jquery动态添加了一个隐藏的Iframe(其中包含StatCounter Html页面的源代码)。然后,我动态设置“感兴趣的产品”在html页面中。因此,statcounter可以使用这种技术在弹出式窗口页面上使用。最终我找到了解决方案。这是我用来实现目标的一个“技巧”。解决方案是这样的。首先,我制作了一个单独的html页面,其中包含statcounter代码,然后在弹出式窗口上使用Jquery动态添加了一个隐藏的Iframe(其中包含statcounter html页面的源代码)。然后我在该html页面中动态设置“感兴趣的产品”。因此,可以使用此技术在弹出页面上使用statcounter。