求 enfd 5401-4101 的资源

什么是跨域
  由于浏览器同源策略,凡是发送请求url的协议、域名、端口三者之间任意一与当前页面地址不同即为跨域。具体可以查看下表()
  这种方式主要是通过动态插入一个script标签。浏览器对script的资源引用没有同源限制,同时资源加载到页面后会立即执行(没有阻塞的情况下)。
1 &script&
var _script = document.createElement('script');
_script.type = "text/javascript";
_script.src = "http://localhost:8888/jsonp?callback=f";
document.head.appendChild(_script);
  实际项目中JSONP通常用来获取json格式数据,这时前后端通常约定一个参数callback,该参数的值,就是处理返回数据的函数名称。
1 &!doctype html&
&meta charset="utf-8"&
&meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&
&title&jsonp_test&/title&
var f = function(data){
alert(data.name);
/*var xhr = new XMLHttpRequest();
xhr.onload = function(){
alert(xhr.responseText);
xhr.open('POST', 'http://localhost:8888/cors', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("f=json");*/
var _script = document.createElement('script');
_script.type = "text/javascript";
_script.src = "http://localhost:8888/jsonp?callback=f";
document.head.appendChild(_script);
1 var query = _url.
console.log(query);
var params = qs.parse(query);
console.log(params);
var f = "";
f = params.
res.writeHead(200, {"Content-Type": "text/javascript"});
res.write(f + "({name:'hello world'})");
res.end();
  缺点:
  1、这种方式无法发送post请求()
  2、另外要确定jsonp的请求是否失败并不容易,大多数框架的实现都是结合超时时间来判定。
  Proxy代理
  这种方式首先将请求发送给后台服务器,通过服务器来发送请求,然后将请求的结果传递给前端。
1 &!doctype html&
&meta charset="utf-8"&
&meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&
&title&proxy_test&/title&
var f = function(data){
alert(data.name);
var xhr = new XMLHttpRequest();
xhr.onload = function(){
alert(xhr.responseText);
xhr.open('POST', 'http://localhost:8888/proxy?/arcgis/rest/services/World/GeocodeServer', true);
xhr.send("f=json");
23 &/html&
1 var proxyUrl = "";
if (req.url.indexOf('?') & -1) {
proxyUrl = req.url.substr(req.url.indexOf('?') + 1);
console.log(proxyUrl);
if (req.method === 'GET') {
request.get(proxyUrl).pipe(res);
} else if (req.method === 'POST') {
var post = '';
//定义了一个post变量,用于暂存请求体的信息
req.on('data', function(chunk){
//通过req的data事件监听函数,每当接受到请求体的数据,就累加到post变量中
req.on('end', function(){
//在end事件触发后,通过querystring.parse将post解析为真正的POST请求格式,然后向客户端返回。
post = qs.parse(post);
method: 'POST',
url: proxyUrl,
form: post
}).pipe(res);
  需要注意的是如果你代理的是https协议的请求,那么你的proxy首先需要信任该证书(尤其是自定义证书)或者忽略证书检查,否则你的请求无法成功。12306就提供了一个鲜活的例子。
  还需要注意一点,对于同一请求浏览器通常会从缓存中读取数据,我们有时候不想从缓存中读取,所以会加一个preventCache参数,这个时候请求url变成:url?preventCache=....;这本身没有什么问题,问题出在当使用某些前端框架(比如jquery)发送proxy代理请求时,请求url为proxy?url,同时设置preventCache:true,框架不能正确处理这个参数,结果发出去的请求变成proxy?url&preventCache=123456(正长应为proxy?url?preventCache=12356);后端截取后发送的请求为url&preventCache=123456,根本没有这个地址,所以你得不到正确结果。
  这是现代浏览器支持跨域资源请求的一种方式。
  当你使用XMLHttpRequest发送请求时,浏览器发现该请求不符合同源策略,会给该请求加一个请求头:Origin,后台进行一系列处理,如果确定接受请求则在返回结果中加入一个响应头:Access-Control-Allow-O浏览器判断该相应头中是否包含Origin的值,如果有则浏览器会处理响应,我们就可以拿到响应数据,如果不包含浏览器直接驳回,这时我们无法拿到响应数据。
1 &!doctype html&
&meta charset="utf-8"&
&meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&
&title&jsonp_test&/title&
/*var f = function(data){
alert(data.name);
var xhr = new XMLHttpRequest();
xhr.onload = function(){
alert(xhr.responseText);
xhr.open('POST', 'http://localhost:8888/cors', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("f=json");
/* var _script = document.createElement('script');
_script.type = "text/javascript";
_script.src = "http://localhost:8888/jsonp?callback=f";
document.head.appendChild(_script);*/
31 &/html&
1 if (req.headers.origin) {
res.writeHead(200, {
"Content-Type": "text/ charset=UTF-8",
"Access-Control-Allow-Origin":'http://localhost'/*,
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type'*/
res.write('cors');
res.end();
  如果我们把Access-Control-Allow-Origin去掉,浏览器会驳回响应,我们也就拿不到数据。
  需要注意的一点是Preflighted Request的透明服务器验证机制支持开发人员使用自定义的头部、GET或POST之外的方法,以及不同类型的主题内容。总结如如:
  1、非GET 、POST请求
  2、POST请求的content-type不是常规的三个:application/x- www-form-urlencoded(使用 HTTP 的 POST 方法提交的表单)、multipart/form-data(同上,但主要用于表单提交时伴随文件上传的场合)、text/plain(纯文本)
  3、POST请求的payload为text/html
  4、设置自定义头部
  OPTIONS请求头部中会包含以下头部:Origin、Access-Control-Request-Method、Access-Control-Request-Headers,发送这个请求后,服务器可以设置如下头部与浏览器沟通来判断是否允许这个请求。
  Access-Control-Allow-Origin、Access-Control-Allow-Method、Access-Control-Allow-Headers
1 var xhr = new XMLHttpRequest();
xhr.onload = function(){
alert(xhr.responseText);
xhr.open('POST', 'http://localhost:8888/cors', true);
xhr.setRequestHeader("Content-Type", "text/html");
xhr.send("f=json");
1 if (req.headers.origin) {
res.writeHead(200, {
"Content-Type": "text/ charset=UTF-8",
"Access-Control-Allow-Origin":'http://localhost',
'Access-Control-Allow-Methods': 'GET,POST,OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type'/**/
res.write('cors');
res.end();
  如果你在调试状态,你会发现后台代码执行了两遍,说明发送了两次请求。注意一下我们的onload代码只执行了一次,所以说OPTIONS请求对程序来说是透明的,他的请求结果会被缓存起来。
  如果我们修改一下后台代码,把Content-Type去掉,你会发现OPTIONS请求失败。
  通过setRequestHeader('X-Request-With', null)可以避免浏览器发送OPTIONS请求。
  根据我的测试,当使用cors发送跨域请求时失败时,后台是接收到了这次请求,后台可能也执行了数据查询操作,只是响应头部不合符要求,浏览器阻断了这次请求。
  这是IE8、IE9提供的一种跨域解决方案,功能较弱只支持get跟post请求,而且对于协议不同的跨域是无能为力的,比如在http协议下发送https请求。看一下微软自己的例子就行
1 &!DOCTYPE html&
&h2&XDomainRequest&/h2&
&input type="text" id="tbURL" value="/xdr.txt" style="width: 300px"&&br&
&input type="text" id="tbTO" value="10000"&&br&
&input type="button" onclick="mytest()" value="Get"&&&&
&input type="button" onclick="stopdata()" value="Stop"&&&&
&input type="button" onclick="readdata()" value="Read"&
&div id="dResponse"&&/div&
function readdata()
var dRes = document.getElementById('dResponse');
dRes.innerText = xdr.responseT
alert("Content-type: " + xdr.contentType);
alert("Length: " + xdr.responseText.length);
function err()
alert("XDR onerror");
function timeo()
alert("XDR ontimeout");
function loadd()
alert("XDR onload");
alert("Got: " + xdr.responseText);
function progres()
alert("XDR onprogress");
alert("Got: " + xdr.responseText);
function stopdata()
xdr.abort();
function mytest()
var url = document.getElementById('tbURL');
var timeout = document.getElementById('tbTO');
if (window.XDomainRequest)
xdr = new XDomainRequest();
xdr.onerror =
xdr.ontimeout =
xdr.onprogress =
xdr.onload =
xdr.timeout = tbTO.
xdr.open("get", tbURL.value);
xdr.send();
alert("Failed to create");
alert("XDR doesn't exist");
78 &/body&
79 &/html&
  以上就是我在实际项目中遇到的跨域请求资源的情况,有一种跨域需要特别注意就是在https协议下发送https请求,除了使用proxy代理外其他方法都无解,会被浏览器直接block掉。如果哪位道友知道解决方法,麻烦你告诉我一声。
  最后附上完整的测试demo
  iss中:
1 &!doctype html&
&meta charset="utf-8"&
&meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&
&title&jsonp_test&/title&
/*var f = function(data){
alert(data.name);
var xhr = new XMLHttpRequest();
xhr.onload = function(){
alert(xhr.responseText);
xhr.open('POST', 'http://localhost:8888/cors', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("aaaa","b");
xhr.send("f=json");
/* var _script = document.createElement('script');
_script.type = "text/javascript";
_script.src = "http://localhost:8888/jsonp?callback=f";
document.head.appendChild(_script);*/
32 &/html&
  node-html
1 &!doctype html&
&meta charset="utf-8"&
&meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&
&title&proxy_test&/title&
var f = function(data){
alert(data.name);
var xhr = new XMLHttpRequest();
xhr.onload = function(){
alert(xhr.responseText);
xhr.open('POST', 'http://localhost:8888/proxy?/arcgis/rest/services/World/GeocodeServer', true);
xhr.send("f=json");
23 &/html&
  node-server
1 var http = require('http');
2 var url = require('url');
3 var fs = require('fs');
4 var qs = require('querystring');
5 var request = require('request');
7 http.createServer(function(req, res){
var _url = url.parse(req.url);
if (_url.pathname === '/jsonp') {
var query = _url.
console.log(query);
var params = qs.parse(query);
console.log(params);
var f = "";
f = params.
res.writeHead(200, {"Content-Type": "text/javascript"});
res.write(f + "({name:'hello world'})");
res.end();
} else if (_url.pathname === '/proxy') {
var proxyUrl = "";
if (req.url.indexOf('?') & -1) {
proxyUrl = req.url.substr(req.url.indexOf('?') + 1);
console.log(proxyUrl);
if (req.method === 'GET') {
request.get(proxyUrl).pipe(res);
} else if (req.method === 'POST') {
var post = '';
//定义了一个post变量,用于暂存请求体的信息
req.on('data', function(chunk){
//通过req的data事件监听函数,每当接受到请求体的数据,就累加到post变量中
req.on('end', function(){
//在end事件触发后,通过querystring.parse将post解析为真正的POST请求格式,然后向客户端返回。
post = qs.parse(post);
method: 'POST',
url: proxyUrl,
form: post
}).pipe(res);
} else if (_url.pathname === '/index') {
fs.readFile('./index.html', function(err, data) {
res.writeHead(200, {"Content-Type": "text/ charset=UTF-8"});
res.write(data);
res.end();
} else if (_url.pathname === '/cors') {
if (req.headers.origin) {
res.writeHead(200, {
"Content-Type": "text/ charset=UTF-8",
"Access-Control-Allow-Origin":'http://localhost',
'Access-Control-Allow-Methods': 'GET,POST,OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type,aaaa'/**/
res.write('cors');
res.end();
65 }).listen(8888);
参考文献:
阅读(...) 评论()《国际市场》 求资源!!!!? - 豆瓣电影
求资源!!!!?
很久没有冲动想这样看一部片子了!!!求资源!!
2014年上映
剧情 / 家庭
其它热门问题
来自《侏罗纪世界》
来自《侏罗纪世界》
来自《末日崩塌》
来自《侏罗纪世界》
& 2005-, all rights reserved苹果/安卓/wp
苹果/安卓/wp
积分 11, 距离下一级还需 13 积分
权限: 设置帖子权限
道具: 彩虹炫, 雷达卡, 热点灯, 雷鸣之声, 涂鸦板, 金钱卡
购买后可立即获得
权限: 隐身
道具: 金钱卡, 雷鸣之声, 彩虹炫, 雷达卡, 涂鸦板, 热点灯
本帖最后由 王志成2010 于
09:28 编辑
如何用AD-AS模型分析资源类投入价格上升对宏观经济的影响? 希望详细解释及所运用的理论知识,最好有图形为例!谢谢
载入中......
急\急!,谁能告诉我从那本书找到相应的理论知识或答案!
可以用新凯恩斯主义的AS-AD模型分析:以原油价格上涨为例,原油价格上升导致企业的成本上升,价格加成变大,AS曲线向上移动,短期的波动结果是价格P上升,出现了结构性通货膨胀,同时产量Y下降,这就是所谓的“滞涨”,20世纪70年代美国因石油冲击就出现了这种现象。因为产量偏离均衡水平,此后AS曲线会不断的下移,价格会不断下降,产量也不断恢复到均衡水平。在短期中如果政府干预,采用扩张性的财政支出或扩张性的货币政策可以使产量迅速回复到均衡水平,与不干预相比,可以使失业降低,但是使通货更加的严重。
lzwbrslzm & & 请问一下,假如&&国内原油价格滞后于国际原油价格~~又会有什么不同~~**应该采取什么宏观经济学措施?
& && && && & 是一道卷子的题。。& && &请大师指点一下~~
这个题有人问过了,也有人解答了,就在这版。
liprayer & &找了半天没找着。。。能不能告诉我一下那个帖子的题目
。。。 谢谢
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
为做大做强论坛,本站接受风险投资商咨询,请联系(010-)
邮箱:service@pinggu.org
合作咨询电话:(010)
广告合作电话:(刘老师)
投诉电话:(010)
不良信息处理电话:(010)
京ICP证090565号
京公网安备号
论坛法律顾问:王进律师求matlab2013b的最全的key
UID655752&帖子494&精华0&积分82072&资产82072 信元&发贴收入2830 信元&推广收入0 信元&附件收入91749 信元&下载支出12742 信元&阅读权限90&在线时间756 小时&注册时间&最后登录&
求matlab2013b的最全的key
现在板上的2个key,装完了工具箱都不全,少了不少。
UID802490&帖子867&精华0&积分395&资产395 信元&发贴收入4450 信元&推广收入0 信元&附件收入0 信元&下载支出4105 信元&阅读权限20&在线时间532 小时&注册时间&最后登录&
ditto,..., 期待中...
UID655752&帖子494&精华0&积分82072&资产82072 信元&发贴收入2830 信元&推广收入0 信元&附件收入91749 信元&下载支出12742 信元&阅读权限90&在线时间756 小时&注册时间&最后登录&
continue...
UID655752&帖子494&精华0&积分82072&资产82072 信元&发贴收入2830 信元&推广收入0 信元&附件收入91749 信元&下载支出12742 信元&阅读权限90&在线时间756 小时&注册时间&最后登录&
顶,没有key,没法用linux版本的,仿真速度上不去啊。
UID655752&帖子494&精华0&积分82072&资产82072 信元&发贴收入2830 信元&推广收入0 信元&附件收入91749 信元&下载支出12742 信元&阅读权限90&在线时间756 小时&注册时间&最后登录&
顶,没有key,没法用linux版本的,仿真速度上不去啊。
jlqsczw_2007 发表于
& & 再次顶起。
UID1218855&帖子28&精华0&积分11064&资产11064 信元&发贴收入180 信元&推广收入0 信元&附件收入2848 信元&下载支出2377 信元&阅读权限70&在线时间211 小时&注册时间&最后登录&
<td class="t_msgfont" id="postmessage_. ------52658
4. ------50915
每一组序列号都可以用,大部分都是重复的,不嫌麻烦的话,分7次安装,最后总功有六十几个工具箱:
MATLAB& && && && && && && && && && && && && && && && &Version 8.2& && &&&(R2013b)
Simulink& && && && && && && && && && && && && && && & Version 8.2& && &&&(R2013b)
Aerospace Blockset& && && && && && && && && && && && &Version 3.12& && & (R2013b)
Aerospace Toolbox& && && && && && && && && && && && & Version 2.12& && & (R2013b)
Bioinformatics Toolbox& && && && && && && && && && &&&Version 4.3.1& && &(R2013b)
Communications System Toolbox& && && && && && && && & Version 5.5& && &&&(R2013b)
Computer Vision System Toolbox& && && && && && && && &Version 5.3& && &&&(R2013b)
Control System Toolbox& && && && && && && && && && &&&Version 9.6& && &&&(R2013b)
Curve Fitting Toolbox& && && && && && && && && && && &Version 3.4& && &&&(R2013b)
DSP System Toolbox& && && && && && && && && && && && &Version 8.5& && &&&(R2013b)
Data Acquisition Toolbox& && && && && && && && && && &Version 3.4& && &&&(R2013b)
Database Toolbox& && && && && && && && && && && && &&&Version 5.0& && &&&(R2013b)
Datafeed Toolbox& && && && && && && && && && && && &&&Version 4.6& && &&&(R2013b)
Econometrics Toolbox& && && && && && && && && && && & Version 2.4& && &&&(R2013b)
Embedded Coder& && && && && && && && && && && && && & Version 6.5& && &&&(R2013b)
Filter Design HDL Coder& && && && && && && && && && & Version 2.9.4& && &(R2013b)
Financial Instruments Toolbox& && && && && && && && & Version 1.2& && &&&(R2013b)
Financial Toolbox& && && && && && && && && && && && & Version 5.2& && &&&(R2013b)
Fixed-Point Designer& && && && && && && && && && && & Version 4.1& && &&&(R2013b)
Fuzzy Logic Toolbox& && && && && && && && && && && &&&Version 2.2.18& &&&(R2013b)
Global Optimization Toolbox& && && && && && && && && &Version 3.2.4& && &(R2013b)
HDL Coder& && && && && && && && && && && && && && && &Version 3.3& && &&&(R2013b)
HDL Verifier& && && && && && && && && && && && && && &Version 4.3& && &&&(R2013b)
Image Acquisition Toolbox& && && && && && && && && &&&Version 4.6& && &&&(R2013b)
Image Processing Toolbox& && && && && && && && && && &Version 8.3& && &&&(R2013b)
Instrument Control Toolbox& && && && && && && && && & Version 3.4& && &&&(R2013b)
MATLAB Builder EX& && && && && && && && && && && && & Version 2.4& && &&&(R2013b)
MATLAB Builder JA& && && && && && && && && && && && & Version 2.3& && &&&(R2013b)
MATLAB Builder NE& && && && && && && && && && && && & Version 4.2& && &&&(R2013b)
MATLAB Coder& && && && && && && && && && && && && && &Version 2.5& && &&&(R2013b)
MATLAB Compiler& && && && && && && && && && && && && &Version 5.0& && &&&(R2013b)
MATLAB Report Generator& && && && && && && && && && & Version 3.15& && & (R2013b)
Mapping Toolbox& && && && && && && && && && && && && &Version 4.0& && &&&(R2013b)
Model Predictive Control Toolbox& && && && && && && & Version 4.1.3& && &(R2013b)
Model-Based Calibration Toolbox& && && && && && && &&&Version 4.6.1& && &(R2013b)
Neural Network Toolbox& && && && && && && && && && &&&Version 8.1& && &&&(R2013b)
OPC Toolbox& && && && && && && && && && && && && && & Version 3.3& && &&&(R2013b)
Optimization Toolbox& && && && && && && && && && && & Version 6.4& && &&&(R2013b)
Parallel Computing Toolbox& && && && && && && && && & Version 6.3& && &&&(R2013b)
Partial Differential Equation Toolbox& && && && && &&&Version 1.3& && &&&(R2013b)
RF Toolbox& && && && && && && && && && && && && && &&&Version 2.13& && & (R2013b)
Real-Time Windows Target& && && && && && && && && && &Version 4.3& && &&&(R2013b)
Robust Control Toolbox& && && && && && && && && && &&&Version 5.0& && &&&(R2013b)
Signal Processing Toolbox& && && && && && && && && &&&Version 6.20& && & (R2013b)
SimBiology& && && && && && && && && && && && && && &&&Version 4.3.1& && &(R2013b)
SimDriveline& && && && && && && && && && && && && && &Version 2.5& && &&&(R2013b)
SimElectronics& && && && && && && && && && && && && & Version 2.4& && &&&(R2013b)
SimEvents& && && && && && && && && && && && && && && &Version 4.3.1& && &(R2013b)
SimHydraulics& && && && && && && && && && && && && &&&Version 1.13& && & (R2013b)
SimMechanics& && && && && && && && && && && && && && &Version 4.3& && &&&(R2013b)
SimPowerSystems& && && && && && && && && && && && && &Version 6.0& && &&&(R2013b)
SimRF& && && && && && && && && && && && && && && && & Version 4.1& && &&&(R2013b)
Simscape& && && && && && && && && && && && && && && & Version 3.10& && & (R2013b)
Simulink 3D Animation& && && && && && && && && && && &Version 7.0& && &&&(R2013b)
Simulink Coder& && && && && && && && && && && && && & Version 8.5& && &&&(R2013b)
Simulink Control Design& && && && && && && && && && & Version 3.8& && &&&(R2013b)
Simulink Design Optimization& && && && && && && && &&&Version 2.4& && &&&(R2013b)
Simulink Design Verifier& && && && && && && && && && &Version 2.5& && &&&(R2013b)
Simulink Report Generator& && && && && && && && && &&&Version 3.15& && & (R2013b)
Simulink Verification and Validation& && && && && && &Version 3.6& && &&&(R2013b)
Spreadsheet Link EX& && && && && && && && && && && &&&Version 3.2& && &&&(R2013b)
Stateflow& && && && && && && && && && && && && && && &Version 8.2& && &&&(R2013b)
Statistics Toolbox& && && && && && && && && && && && &Version 8.3& && &&&(R2013b)
Symbolic Math Toolbox& && && && && && && && && && && &Version 5.11& && & (R2013b)
System Identification Toolbox& && && && && && && && & Version 8.3& && &&&(R2013b)
SystemTest& && && && && && && && && && && && && && &&&Version 2.6.6& && &(R2013b)
Vehicle Network Toolbox& && && && && && && && && && & Version 2.1& && &&&(R2013b)
Wavelet Toolbox& && && && && && && && && && && && && &Version 4.12& && & (R2013b)
xPC Target& && && && && && && && && && && && && && &&&Version 5.5& && &&&(R2013b)
xPC Target Embedded Option& && && && && && && && && & Version 5.5& && &&&(R2013b)
UID356300&帖子9&精华0&积分7601&资产7601 信元&发贴收入10250 信元&推广收入0 信元&附件收入0 信元&下载支出2959 信元&阅读权限50&在线时间121 小时&注册时间&最后登录&
@七MSN都可以用同一datn幔
[通过 QQ、MSN 分享给朋友]

我要回帖

更多关于 enfd 5401 的文章

 

随机推荐