Detailed explanation of JavaScript splicing html fragments using backslash examples

高洛峰
Release: 2017-03-26 10:46:00
Original
2946 people have browsed it

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;);
Copy after login

It can run normally and is equivalent to str+="

". 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!