我正在尝试根据中间点拆分字符串。出于某种原因,它没有识别它。我可以使用“管道”字符,所以我知道其他一切都在工作,但不是中间的点。我需要逃避中间的点吗?如果是这样,如何?
Javascript
var sTags = $(this).text();
// alert(sTags);
sSplitTags = sTags.split(' | ');
// Split isn't recognizing the middot
// var sSplitTags = sTags.split(' · ');
// var sSplitTags = sTags.split(' · ');
// var sSplitTags = sTags.split(' · ');
alert(sSplitTags[0]);
Run Code Online (Sandbox Code Playgroud)
HTML
<div>Upscale · Gadget</div>
<div>Expensive · Widget</div>
<div>Expensive · Widget</div>
Run Code Online (Sandbox Code Playgroud)
提前致谢!