cross-domain

Execute javascript function in a another iframe when parent is from different domain - with jQuery?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 22:13:54
问题 Yes , It's a similar question as in here , but mine is tagged with jquery. in short : I have this scenario : both documents ( x.B.com and y.B.com ) has document.domain="B.com" ; But lets say Im in y.B.com and I want to execute work() Running parent.frames['if1'].work(2); -- is working. But I tried doing it with jQuery : (didn't succeed) $('#if1', parent.document).contents().work(2); $('#if1', parent.document)[0].work(2); How can I do it ? 回答1: If you can do it without jQuery, the amount of

Calling a webservice through jquery cross domain

你离开我真会死。 提交于 2019-12-12 20:35:41
问题 I am trying to connect to a .asmx webservice (cross domain) by means of client-side script now actually i am having problems to use POST since it is being blocked and in firebug is giving me: OPTIONS Add(method name) 500 internal server error. I bypassed this problem by using GET instead, it is working fine when not inputting any parameters but is giving me trouble with parameters. please see below for the code. The following is a simple example I am trying to make work out with the use of

setting $_SESSION (php) with remote server using angularJS code not working

南楼画角 提交于 2019-12-12 18:25:07
问题 I have an api with php implemented for login authenrication: http://somerestsertver.net/sampleapi/auth-login this sets the login session id (e.g. after verifying user credentials) http://somerestsertver.net/sampleapi/auth-check this checks the login is valid if the session id is set or not http://somerestsertver.net/sampleapi/auth-logout and this destroys the session and needed logout ... I set login with $_SESSION["id"]=1 when auth-login in the code then auht-check would be ok, otherwise the

AJAX and Cross-Site Scripting to Read the Header

我的梦境 提交于 2019-12-12 16:38:00
问题 Help me understand AJAX and cross-site scripting a little better. Writing AJAX is fairly straight forward. If I want to asynchronously read HTTP header of a website, I'd do something like this: var req = new XMLHttpRequest(); req.open('HEAD', 'http://www.stackoverflow.com/', true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) alert(req.responseText); else alert("Error loading page"); } }; req.send(null); However, when I copy and paste this into a

SecurityError for same-origin image texImage2D

不想你离开。 提交于 2019-12-12 15:42:06
问题 I am currently learning WebGL. In a call to texImage2D, which is called when a texture has finished loading, I get the following SecurityError : Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at /path/to/texure.png may not be loaded. However, the file is on the same domain, in fact it is in the same directory as the html file requesting it. Here is the file layout: > js |-> script.js |-> glUtils.js |-> sylvester.js > texture.png >

Cross domain request with xmlHttpRequest and Paypal

跟風遠走 提交于 2019-12-12 11:55:52
问题 I am trying to do a cross domain request with XMLHttpRequest object, because with $.ajax it doesn't work in IE, only in Chrome, Firefox and Safari. Below is a code sample $("#btn").click(function () { CallWithXhr(); }); function CallWithXhr() { var xhr = new XMLHttpRequest(); xhr.open("POST", "https://www.sandbox.paypal.com/cgi-bin/webscr", true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); xhr.send(); xhr.onload =

jQuery .load() equivalent AngularJS

只愿长相守 提交于 2019-12-12 11:00:05
问题 Is there an AngularJS equivalent to $.load() in jQuery? I want to be able to pull from another domain (i.e. post the app on one domain, but load content from a completely separate address). 回答1: jQuery methods of usage don't really fit Angular, you won't find load equivalent there (you obviously can use jQuery instead of jqLite if you want it badly). Angular proposes the usage of ngInclude directive for similar off-hand scenarios. Otherwise you need to make your own directive and write the

Make google Recaptcha work with special characters in the domain name

左心房为你撑大大i 提交于 2019-12-12 10:38:32
问题 I was setting up an API key for a site with the swedish charachter ä in the domain name (http://sälja.io) but it did not initialize the recaptcha. Then trying an api key for the equivalent url http://xn--slja-loa.io which worked when reaching the site from http://xn--slja-loa.io but not http://sälja.io. Then I found the secure token which should work on all domains. It initialized the recaptchas on all domains and was also working on all tested domains, except the one with ä in it . https:/

Is it possible to use HTML5's pushState() across multiple domains?

烂漫一生 提交于 2019-12-12 09:45:25
问题 I have almost impossible problem, but I am hoping someone could come up with some working solution or workaround. I have a website where I use History.js to do on-demand page changes to prevent loading full page when clicking on links. My website however has multiple domains, so cross-domain policy doesn't allow change full URL with host, only relative path can be changed/set. Can anyone help me, how to make use of History.js and overcome cross-domain policy ? However, I can't stop using

angular js nginx cors - No 'Access-Control-Allow-Origin' header

天大地大妈咪最大 提交于 2019-12-12 09:16:08
问题 I know different versions of this same question have been asked, I have read all of the related questions and answers I could find on SO and Google. I am trying to make a cross domain request from an angularJS app to an nginx server. All of the GET requests behave properly but my POST request does not. Chrome was giving me a 'Access-Control-Allow-Origin' error so I added the following to my nginx server config: location / { if ($http_origin ~* (https?://.*\.mysite\.com(:[0-9]+)?)) { set $cors