What does a script-Tag with src AND content mean?

后端 未结 4 724
执笔经年
执笔经年 2020-11-22 06:42

Example from Googles +1 button:



        
4条回答
  •  轮回少年
    2020-11-22 06:46

    If a script element has a src attribute, the content must be ignored, any other behaviour is non-conformant.

    It has been suggested in blogs (as a hack) to put content in the element knowing that it won't be evaluated, then use DOM methods to get the content as a string and either eval it or insert it in a new script element. Neither of these are a good idea.

提交回复
热议问题