开关电源输入输出共地出和输入简称是什么I/P和O/P是什么

已选条件:
主屏尺寸:
外观颜色:
其他参数:
主屏分辨率
屏幕像素密度
后置摄像头
前置摄像头
更多选项(RAM容量,ROM容量)等
共 1575 款
参考价:¥3598
参考价:¥2699
参考价:¥3788
参考价:¥8388
参考价:¥2499
参考价:¥6699
参考价:¥4988
参考价:¥3299
参考价:¥1999
参考价:¥1260
参考价:¥2898
参考价:¥5799
参考价:¥4638
参考价:¥1598
参考价:¥1799
参考价:¥3899
参考价:¥2599
参考价:¥2798
参考价:¥3988
参考价:¥2599
参考价:¥3488
参考价:¥5618
参考价:¥2999
参考价:¥4899
参考价:¥2439
参考价:¥4858
参考价:¥9999
参考价:¥2799
参考价:¥2499
参考价:¥1299
参考价:¥4799
参考价:¥999
参考价:¥1499
参考价:¥899
参考价:¥3450
参考价:¥1959
参考价:¥2830
参考价:¥1699
参考价:¥3299
参考价:¥1099
参考价:¥2688
参考价:¥3000[缺货]
参考价:¥2799
参考价:¥1799
还有款手机&&json - XMLHttpRequest cannot load an URL with jQuery - Stack Overflow
to customize your list.
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
I'm trying to get some json data from a "remote" website.
I run my web service on the 99000 port then, I launch my website on the 99001 port (http://localhost:99001/index.html).
I get the following message:
XMLHttpRequest cannot load http://localhost:99000/Services.svc/ReturnPersons. Origin http://localhost:99001 is not allowed by Access-Control-Allow-Origin.
Even If I launch my web page as an HTML file, I get this:
XMLHttpRequest cannot load http://localhost:99000/Services.svc/ReturnPersons.Origin null is not allowed by Access-Control-Allow-Origin.
The web service returns data. I try to catch the data items like this:
var url = "http://localhost:99000/Services.svc/ReturnPersons";
$.getJSON(url, function (data) {
success: readData(data)
function readData(data) {
alert(data[0].FirstName);
And I'm trying to get this structure:
[{"FirstName":"Foo","LastName":"Bar"},{"Hello":"Foo","LastName":"World"}]
Do you know why I'm getting this error?
25.5k66180
9,4361772118
You can't do a XMLHttpRequest crossdomain, the only "option" would be a technique called JSONP, which comes down to this:
To start request: Add a new &script& tag with the remote url, and then make sure that remote url returns a valid javascript file that calls your callback function. Some services support this (and let you name your callback in a GET parameters).
The other easy way out, would be to create a "proxy" on your local server, which gets the remote request and then just "forwards" it back to your javascript.
edit/addition:
I see jQuery has built-in support for JSONP, by checking if the URL contains "callback=?" (where jQuery will replace ? with the actual callback method). But you'd still need to process that on the remote server to generate a valid response.
82.5k23169214
In new jQuery 1.5 you can use:
type: "GET",
url: "http://localhost:99000/Services.svc/ReturnPersons",
dataType: "jsonp",
success: readData(data),
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
in action.
Given an external JSON:
myurl = 'http://wikidata.org/w/api.php?action=wbgetentities&sites=frwiki&titles=France&languages=zh-hans|zh-hant|fr&props=sitelinks|labels|aliases|descriptions&format=json'
Solution 1: $.ajax() + jsonp:
dataType: "jsonp",
url: myurl ,
}).done(function ( data ) {
// do my stuff
Solution 2: $.ajax()+json+&calback=?:
dataType: "json",
url: myurl + '&callback=?',
}).done(function ( data ) {
// do my stuff
Solution 3: $.getJSON()+calback=?:
$.getJSON( myurl + '&callback=?', function(data) {
// do my stuff
Documentations:
7,4521055127
Found a possible workaround that I don't believe was mentioned.
Here is a good description of the problem:
Basically as long as you use forms/url-encoded/plain text content types you are fine.
type: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'text/plain'
dataType: "json",
url: "http://localhost/endpoint",
data: JSON.stringify({'DataToPost': 123}),
success: function (data) {
alert(JSON.stringify(data));
I use it with ASP.NET WebAPI2. So on the other end:
public static void RegisterWebApi(HttpConfiguration config)
config.MapHttpAttributeRoutes();
config.Formatters.Clear();
config.Formatters.Add(new JsonMediaTypeFormatter());
config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/plain"));
This way Json formatter gets used when parsing plain text content type.
And don't forget in Web.config:
&system.webServer&
&httpProtocol&
&customHeaders&
&add name="Access-Control-Allow-Origin" value="*" /&
&add name="Access-Control-Allow-Methods" value="GET, POST" /&
&/customHeaders&
&/httpProtocol&
Hope this helps.
I am using WebAPI 3 and was facing the same issue. The issue has resolve as @Rytis added his solution. And I think in WebAPI 3, we don't need to define method RegisterWebApi.
My change was only in web.config file and is working.
&httpProtocol&
&customHeaders&
&add name="Access-Control-Allow-Origin" value="*" /&
&add name="Access-Control-Allow-Methods" value="GET, POST" /&
&/customHeaders&
&/httpProtocol&
Thanks for you solution @Rytis!
2,76252030
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled盗撮インパクトアクセス順
盗撮インパクトアクセス順
までのランキングです
ランキングに載るには最低 1 アクセス必要です
最終更新は04/23 08:16 です。
件数149684}

我要回帖

更多关于 电源输入输出接口 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信