Why split the [removed] tag when writing it with [removed]()?

前端 未结 5 1185
挽巷
挽巷 2020-11-21 07:37

Why do some sites (or advertisers that give clients javascript code) employ a technique of splitting the tags

5条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 08:11

    Here's another variation I've used when wanting to generate a script tag inline (so it executes immediately) without needing any form of escapes:

    
    

    (Note: contrary to most examples on the net, I'm not setting type="text/javascript" on neither the enclosing tag, nor the generated one: there is no browser not having that as the default, and so it is redundant, but will not hurt either, if you disagree).

提交回复
热议问题