防止 javascript GET 和 Script [英] Prevent javascript GET and Script

查看:27
本文介绍了防止 javascript GET 和 Script的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何限制 Javascript Get、Post 请求到指定域的方法?我也可以以某种方式禁用 JSONP 吗?

Is there anyway to limit Javascript Get, Post request to a specified domain? Also can I somehow disable JSONP?

我想开发一个 Web 内容框架,让人们可以在不同的页面中包含 javascript,但我不希望这些脚本访问任何其他域.

I want to develop a web content framework where people can include javascripts in different pages but I don't want those scripts to access any other domain.

我熟悉 firefox 的内容安全策略",但不幸的是,这只适用于 firefox.

I am familiar with firefox "Content Security Policy" but unfortunately that is only applicable to firefox.

推荐答案

默认情况下它是禁用的".如果要允许"json,则必须添加 jsonp 回调.没有它,js 将无法检索 json 响应.

It's "disabled" by default. If you want to "allow" json, you would have to add jsonp callback. Without it, js isn't able to retreive json response.

这篇关于防止 javascript GET 和 Script的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆