Home  >  Article  >  Web Front-end  >  Detailed explanation of JavaScript splicing html fragments using backslash examples

Detailed explanation of JavaScript splicing html fragments using backslash examples

高洛峰
高洛峰Original
2017-03-26 10:46:002993browse

JS uses "\" backslash splicing

$(&#39;#result_ok&#39;).append(&#39;<p>\
                    预约挂号医院:西安市第八医院\
                    </p>\
                    <p>\
                        预约挂号科室:皮肤科-1科室 皮肤科\
                    </p>\
                    <p>\
                        预约挂号医生:<label>皮肤科-医生001</label> \
                    </p>\
                    <p>\
                        预约医生级别:<label>名老专家</label> \
                    </p>\
                    <p>\
                        诊金及挂号费:\
                        <label>\
                            100\
                        </label>\
                        元\
                    </p>\
                    <p>\
                        预约就诊时间:\
                        <label>\
                            2015-05-25\
                        </label>\
                        <label>\
                            上午 8:00~12:00\
                        </label>\
                    </p>&#39;);

It can run normally and is equivalent to str+="e388a4556c0f65e1904146cc1a846bee". Each line must have the fixed format of str+=, which must be simplified (lazy)

The above is the detailed content of Detailed explanation of JavaScript splicing html fragments using backslash examples. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn