我在 JavaScript 的帮助下从页面中抓取数据并显示在 fancybox 弹出窗口上。
var str = "$26.61 - Framed bulletin board offers a self-stick surface for quick and easy note positioning, repositioning, and removing.";
但是,当我输出它时,我得到了这个:
$26.61 , Framed bulletin board offers a self,stick surface for quick and easy note positioning, repositioning, and removing.
这是一些javascript:
var pro_desc = $('meta[name=Description]').attr("content");
var shortDesc = $.trim(pro_desc).substring(0, 225);
var count1 = shortDesc.search(/$/i);
if(count1!=-1) {
var short_desc1 = shortDesc.replace("$", "");
var short_desc2 = short_desc1.split("-");
var desc1 = short_desc2;
} else {
alert('In Else Section---'+shortDesc);
}
var product_description = desc1;
alert(product_description);
为什么我的输出有,
's 而不是-
's?