How to get a Script Tag's innerHTML

前端 未结 5 1780
梦如初夏
梦如初夏 2021-01-19 20:02

Alright... I\'ve been searching for an hour now... How does one get the innerHTML of a script tag? Here is what I\'ve been working on...



        
5条回答
  •  面向向阳花
    2021-01-19 20:44

    You can't do this. It would be a massive security problem if you could.

    Script content can include any number of things. Consider this: a script loaded from a URL on your bank's website might contain all sorts of things, like your account number, your balance, and other personal information. That script would be loaded by your bank's normal pages to do what they want to do.

    Now, I'm an evil hacker, and I suspect you may be a customer of Biggo Bank. So on one of my own pages, I include a

提交回复
热议问题