cross-domain

Best method: Access-Control-Allow-Origin Multiple Origin Domains

断了今生、忘了曾经 提交于 2019-12-18 11:42:28
问题 This question has been asked on here before and given an array of good answers, mainly: Access-Control-Allow-Origin Multiple Origin Domains? However there seems to be a gap in explanation in terms of the approved method that should be undertaken. Reading through the W3 documentation we have what appears to me to be a conflict of guidance. Firstly we see the answer given as the right way to do it in a lot of the previous answers which dictates that the host server must dynamically echo back

Google Analytics Cross Domain Tracking and _setDomainName()

北战南征 提交于 2019-12-18 10:53:05
问题 I'm trying to set up cross domain tracking between two totally different Domains (not sub-domains). Looking through different pages of Google's documentation seem to give me different suggestions for what to put in the _setDomainName method. I can't figure out when I'm supposed to use which of these three: _gaq.push(['_setDomainName', 'mysite.com']); _gaq.push(['_setDomainName', '.mysite.com']); _gaq.push(['_setDomainName', 'none']); Can anyone out there give me some guidance or an

XMLHttpRequest succeeds without manifest permissions? Maybe CORS?

放肆的年华 提交于 2019-12-18 09:17:55
问题 I have developed a Google Chrome extensions that uses YouTube Data API v2 . My permission field in the manifest looks like this, because the script is injected in pages under youtube.com and I also need access to tabs: "permissions": ["tabs", "*://*.youtube.com/*"] This also works when I do a request to YouTube Data API v2 because the request is done to http://gdata.youtube.com/, so it is the same domain. But now I am migrating to YouTube Data API v3 , and the requests must be done to http:/

PHP 'file_get_contents' does not work from server

梦想的初衷 提交于 2019-12-18 09:05:12
问题 I have a website (PHP) hosted in Yahoo small business and application (Java) Hosted in Rackspace. I am making a file_get_contents from website to application. which works fine in my local. but when i try the same after deploying it in server does not work. Here i am making arequest which sends list of training in JSON format. PHP part $trainingArrayJson = file_get_contents('http://mywebapplication.com/publicTraining/getTrainingsAsJson/'); $trainingArray = json_decode($trainingArrayJson); ----

Google Translate API - No Access Control Origin with Text to Speech

≡放荡痞女 提交于 2019-12-18 08:55:29
问题 I posted this question on SO to get Google Translate Text-To-Speech to work. Google Translate API text-to-speech: http requests forbidden I was told I needed a key and to enable billing. I've since done that. I know billing is enabled because, using their specified endpoint for words-only translations (not narrated speech) ( GET https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q=Hello%20world ), I'm able to get a response both in DHC and in my

Mailchimp how to call mailchimp 3.0 API in javascript

只谈情不闲聊 提交于 2019-12-18 08:53:48
问题 I am trying to subscribe an email to a list on mailchimp, I followed the documentation first, made a request using "Postman" added what was needed and everything works just fine, so I tried to do it on my website and it didn't work I tried to made a simple request with the same values I set on postman, but everytime I try to send the request the response says XMLHttpRequest cannot load https://us12.api.mailchimp.com/3.0/lists/xxxxxx/members. Response to preflight request doesn't pass access

Are 127.0.0.1 and localhost considered as two different domains by browsers?

血红的双手。 提交于 2019-12-18 08:49:18
问题 Are 127.0.0.1 and localhost considered as two different domains by browsers and therefore enforce cross-domain (same origin policy) restrictions? I observed it works sometime (in case of simple web pages) and does not work with Flex based web pages. For example: Scenario I: In a web page called page1.htm, you call a script as follows: <script type="text/javascript" src="js/somejsscript.js"></script> or <script type="text/javascript" src="http://localhost/js/somejsscript.js"></script> and you

jQuery ajax POST from local file to access a cross domain not working

荒凉一梦 提交于 2019-12-18 06:44:47
问题 As the title says, I'm trying to access (POST) using jQuery AJAX call to a web url, http://host:port/... or http://localhost:8080/... from a local HTML file, c:\home.html . I can't get it to work. I did Google and also saw several questions here but I can't get it to work. I need some help here. Here is what I've tried so far. dataType: jsonp crossDomain: true Setting the header in my response: response.setHeader("Access-Control-Allow-Origin", "*"); None of the three browsers are working - IE

jQuery ajax POST from local file to access a cross domain not working

可紊 提交于 2019-12-18 06:44:38
问题 As the title says, I'm trying to access (POST) using jQuery AJAX call to a web url, http://host:port/... or http://localhost:8080/... from a local HTML file, c:\home.html . I can't get it to work. I did Google and also saw several questions here but I can't get it to work. I need some help here. Here is what I've tried so far. dataType: jsonp crossDomain: true Setting the header in my response: response.setHeader("Access-Control-Allow-Origin", "*"); None of the three browsers are working - IE

Can I use XMLHttpRequest on a different port from a script file loaded from that port?

牧云@^-^@ 提交于 2019-12-18 05:50:32
问题 I have website that use XMLHttpRequest (jQuery, actually). I also have another site running on the same server, which serves a script file that makes XHR requests back to THAT site, ie. http://mysite:50000/index.html includes <script src="http://mysite:9000/otherscript.js"></script> and http://mysite:9000/otherscript.js includes $.ajax({ url: 'http://mysite:9000/ajax/stuff' }); The problem is - this doesn't work. The AJAX requests from the loaded script simply fail with no error message. From