开发者

Javascript Splitting Strings

开发者 https://www.devze.com 2022-12-28 04:11 出处:网络
I came across an block of Javascript code to split a paragraph with the dom structure. The code is as follows:

I came across an block of Javascript code to split a paragraph with the dom structure.

The code is as follows:

string.split("<b" + "r>");

I am a little confused as to why do they have to use a PLUS SIGN and split the parameter into lookup strings?

Why not just use

string.split("<br>");

Is there a techn开发者_Go百科ique or browser issue involved here?


The only thing I can think of is a measure against the <br> tag getting interpreted. In what situation this might happen, I don't know, though. Maybe some very stupid browser or parser screwed up the script and actually rendered the tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消