cross-domain

CORS preflight channel did not succeed

▼魔方 西西 提交于 2019-12-23 08:05:21
问题 I'm trying to build a Ember app with PHP REST framework as my api locally. The Ember app is being served at http://localhost:4200 and the api is being served from just http://localhost . This is causing a CORS issue. I've tried everything that I can think of, but I keep getting an error back saying the request was blocked and that the preflight channel did not succeed. It doesn't succeed in Firefox or Chrome. I've added the following to the .htaccess file for my api: Header set Access-Control

Javascript Cross domain JSON

一个人想着一个人 提交于 2019-12-23 07:38:47
问题 Hi I am trying to use ONLY JavaScript and HTML to read the json object from a URL. I am using the following code: function getJSONP(url, success) { var ud = '_' + +new Date, script = document.createElement('script'), head = document.getElementsByTagName('head')[0] || document.documentElement; window[ud] = function(data) { head.removeChild(script); success && success(data); }; script.src = url.replace('callback=?', 'callback=' + ud); head.appendChild(script); } getJSONP('http://webURl?

AJAX, Subdomains and the 200 OK response

匆匆过客 提交于 2019-12-23 05:28:06
问题 A non-hypothetical but abstracted situation: I have a domain www.foo.com, from which I'm making an AJAX POST to beta.foo.com. Examining the XHR object, I see a response header of 200 OK, but no response text - I even get a response 12B long, which is the exact response (a 12-character string) that I'm expecting - but the response text is blank. If this is a cross-domain issue, why am I getting 200 OK, and better yet - why am I seeing the PHP functions fire on the beta.foo.com side - yet

Jquery: Cross-domain ajax 'POST' with laravel

▼魔方 西西 提交于 2019-12-23 04:45:15
问题 I'm trying to do an ajax 'POST' on laravel server from another domain from jquery.My laravel Route consists of the codes below: Route::post('auth', function(){ $data = Input::get('username'); return Response::json($data->toArray())->setCallback(Input::get('callback'),JSON_PRETTY_PRINT); }); My client is from different server, and the JQuery ajax 'POST' is: function authUser(appId){ var data = '{"username": "' + appId + '"}'; $.ajax({ url: "http://localhost:8080/auth", type: "POST", dataType:

Cross ajax domain by using proxy

微笑、不失礼 提交于 2019-12-23 04:35:49
问题 I'm currently trying to make some ajax post between cross-domains by following this tutorial but something wrong some data wasn't send. Actually my proxy script is a copy of the tutorial and this my javascript : $.ajax({ type: 'POST', data: data + '&origin=' + origin, url: 'customer.php', dataType: 'json', async: false, success: function(result){ if (result.id && result.quotation_id){ id = result.id; quotation_id = result.quotation_id; } } }); 回答1: Solved by making a php script with curl : /

Determine URL of client request from server side. Socket.io

半世苍凉 提交于 2019-12-23 04:34:05
问题 Ref: Socket.io Client Request Origin URL Ref: Socket.io - How to get client URL request on server side? How do you determine the URL of client request from server side? Client request may come from multiple domains. 回答1: socket.io stores the request object from the original request that initiated the socket.io connection in socket.request . On this request object is: request.url request.headers The .url property will be the path of the URL (everything after the protocol, hostname and port).

Create a http proxy in php for uploading images using 'iframe'

泄露秘密 提交于 2019-12-23 00:51:10
问题 Use Case : I am working on an image uploader which uses ajax upload function.I want to upload images to a subdomain user creates on the website.For example,when the user creates a domain on the website I copy a php script for uploading images to the new domain viz image-cropping.php .I want to send a request to this file when the user uploads any image to his domain. Issue : When I try to upload an image I get Error: Permission denied to access property 'readyState' .My calling js file is on

Is a javascript bookmarklet that can set domain cookies breaking cross-domain security?

﹥>﹥吖頭↗ 提交于 2019-12-22 18:39:33
问题 I am creating a bookmarklet that is to be used across a wide range of domains. I wanted to set some cookies to store temporary settings for this bookmarklet, so I assumed that setting a cookie from this script would assign the cookie to the domain of the script's origin. This was not the case, the bookmarklet is able to assign cookies to the domain of the current site being viewed. This is not suitable for my needs (this would remember settings per domain, rather than for the bookmarklet

AngularJS and Laravel - crossdomain CORS / XHR requests lacking (remember_) cookies

强颜欢笑 提交于 2019-12-22 17:59:59
问题 My CORS / XHR requests lacking the remember_xyz cookie in the request headers when i don't use the --disable-web-security option in chrome. If i enable that option the remember_xyz cookie will be included in the request headers and everything is working fine. As workaround i'm currently sending the auth credentials via basic auth header. But i think that's not the intended or right way. How can i get that remember cookie included in the request headers? Edit: In chrome's network console i can

How to output JSON from within Django and call it with jQuery from a cross domain?

隐身守侯 提交于 2019-12-22 14:42:31
问题 For a bookmarklet project I'm trying to get JSON data using jQuery from my server (which is naturally on a different domain) running a Django powered system. According to jQuery docs: "As of jQuery 1.2, you can load JSON data located on another domain if you specify a JSONP callback, which can be done like so: "myurl?callback=?". jQuery automatically replaces the ? with the correct method name to call, calling your specified callback." And for example I can test it successfully in my Firebug