开发者

how do we read the "contents" of a `<script>` tag?

开发者 https://www.devze.com 2023-03-10 18:57 出处:网络
I like the JSONP where we can get info cross-domainly however, what if some services do not support JSONP (and hence do not provide a callback?)

I like the JSONP where we can get info cross-domainly however, what if some services do not support JSONP (and hence do not provide a callback?)

I need a solution to this problem.

I'm thinking if we have a tag like this <script id="s1" source="http://other.com/asd"></script> how do we go about extracting the "contents" of s1 ?

Initially I'd thought s1.innerHTML wo开发者_运维技巧uld do the trick but well.. apparently it doesn't do the trick.

I'm wondering if anyone has any "hacks" that they would love to share.

HACKS ARE WELCOMED


This is a security feature. In the absence of any major security flaws, there's no way to perform a cross-site request without the cooperation of the site you're making the request to.

0

精彩评论

暂无评论...
验证码 换一张
取 消