Questions tagged [cross-domain]

Cross-domain denotes web applications that establish communication beyond their own hosting domain or web server. This may involve sending network requests to external servers or exchanging data with DOM components sourced from distinct domains integrated within the same web page.

Issue with jQuery Ajax not functioning properly across domains in Internet Explorer 9

I am facing an issue accessing a REST web service through jQuery. The Access-Control-Allow-Origin is correctly set to * as seen in Firebug, and Chrome/Firefox have no trouble accessing it. However, Internet Explorer seems to be causing trouble. I have gon ...

How can one determine the source of an Express server-to-server request?

Is it possible to retrieve the source information of a remote server that is sending requests to my api server? I am looking for a way to prevent any potential spoofing of server-to-server authentication tokens. In my testing, I sent remote requests to th ...

Leveraging SproutCore for Cross-Domain Service Requests

I have been struggling to find a solution to this issue. My webapp is hosted on my domain, www.myDomain.com. I need to call a service from another domain, www.anotherDomain.com/service.do. I am using SproutCore's SC.Request.getUrl(www.anotherDomain. ...

Is using window.postMessage(...) a viable option for facilitating cross domain file uploads?

I'm wondering if there is a way to achieve cross domain file upload using window.postMessage(...) or any other technique. Can anyone help with this? ...

Why does my Javascript cross-domain web request keep failing with a Status=0 error code?

UPDATE: I've been informed that this method doesn't work because craigslist doesn't have an Allow-Cross-Domain header set. Fair point. Is there an alternative way to download a page cross-domain using Javascript in Firefox? It's worth noting that the foll ...

Error: JSONP Label Validation Failed

My JSON URL is: The above URL returns the following JSON: { token: "2cd3e37b-5d61-4070-96d5-3dfce0d0acd9%a00a5e34-b017-4899-8171-299781c48c72" } Edit: Changed it to {"token": "2cd3e37b-5d61-4070-96d5-3dfce0d0acd9%a00a5e34-b017-4899-8171-299781c48c72"} ...

The jQuery .post function is successfully executing, but it is strangely triggering the .fail method without

My data is successfully being posted, but I'm struggling to get my .post response handler code to work efficiently. The results seem inconsistent across different browsers and tools that I have tried. Here's the code snippet for the post: $.post(form.attr ...

Error encountered while using Google Translate with XMLHttpRequest (Missing 'Access-Control-Allow-Origin' header)

Trying to access a page that utilizes Google Translate is resulting in the following error: XMLHttpRequest cannot load http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit. No 'Access-Control-Allow-Origin' heade ...

Interconnected realms communication

I'm currently in the process of developing a Facebook iframe app. At one point, I initiate a friends dialog from Facebook and embed an HTML button to add some customized functionality for my app. dialog = FB.ui({ method:'fbml.di ...

Cross domain request in a simple HTML document

I'm currently working on an app that is strictly in plain HTML files without a server. I'm facing difficulties with cross domain requests from JavaScript. Whenever I try to make a request, the browser displays this error message: XMLHttpRequest cannot loa ...

Transforming the AngularJS $http GET method to OPTION and including custom headers

var users= $resource('http://myapp.herokuapp.com/users', {}); users.get(); The change in the HTTP GET method to OPTION occurred after implementing a header method. var users= $resource('http://myapp.herokuapp.com/users', {}, { get:{ method:"G ...

Is it possible for JavaScript within an <iframe> to access the parent DOM when

Is it possible for javascript in an iframe from a different domain to modify the parent's DOM? I need my iframed script to add new html elements to the parent page - any suggestions? Edit: One potential solution is using "Fragment ID Messaging" to communi ...

Encountering an Invalid Host header while connecting a domain name with a reactjs application

Currently, I am in the process of deploying a JS application (with the backend in nodejs and front-end in reactjs) on a hosting server. To ensure smooth operation, I have dockerized all components including the back end, front end, and database. As of now, ...

Phonegap on iOS Simulator experiencing issues with executing cross-domain ajax requests

As I embark on my journey with Phonegap and mobile development, I am encountering a roadblock when trying to make a call to $.ajax(...) from the iOS simulator or an iOS device. Surprisingly, everything works perfectly when running the app from a browser or ...

Unexpected token error occurs when making cross-domain AJAX requests to the server and receiving a JSON object

I have set up an express server to handle get requests to specific url endpoints. When responding to these requests, I am sending back data in JSON format to enable making Ajax calls and retrieving data from the page. To allow for cross-domain requests, I ...

Every time I attempt to make an HTTP request, I encounter a cross-origin error

When I make requests from the browser, they are valid. However, when using the Angular 9 app, I receive a 401 error. Below is the header from Chrome: Request URL: http://localhost:1234/api/Common/GetMy_List Request Method: GET Status Code: 401 Referre ...

Contrast between gmaps and traditional cross-domain AJAX queries

I am curious about the behavior of the getJSON method when making an ajax call to specific addresses. For example, when I make a call to "", no errors are generated. However, if I try to call an external domain that is not Google, the browser throws an e ...

Troubleshooting issues with cross-domain jQuery ajax requests

Struggling with this code and unable to make it work. This call consistently returns a "Failed to load resource: the server responded with a status of 401 (Unauthorized)" error message. $('#btnZendesk').click(function () { $.ajax({ url: ...

Invent a transformative proxy server that alters the referer

I'm currently working on an IIS server and I need to redirect all requests to an S3 bucket. The access is granted through the referer, however, my proxy server only shows the host as "proxy.domainhost.com". In order to achieve this, I am using the request ...

Angular HttpClient does not support cross-domain POST requests, unlike jQuery which does

I am transitioning to Angular 13 and I want to switch from using jQuery.ajax to HttpClient. The jquery code below is currently functional: function asyncAjax(url: any){ return new Promise(function(resolve, reject) { $.ajax({ type: ...

Making a POST request across domains without relying on any third-party frameworks

Is it possible to create a cross-domain request using vanilla JavaScript without relying on frameworks like jQuery? I am looking to send a JSON to a service on a different domain and receive the response using a callback function. Can this be done solely ...

Avoiding the storage of POST data in JSON format

Here is some code I am working with: var jsonString = "some string of json"; $.post('proxy.php', { data : jsonString }, function(response) { var print = response; alert(print); }); And this P ...

IE11 experiencing issues with Cross Domain AJAX requests

I have been attempting to perform a cross domain AJAX call, and I've encountered a problem where it works in Chrome and Firefox, but not in IE11. Upon inspecting the Network tab in IE11 Developer Tools, it appears that the AJAX call is being dropped as n ...

jQuery fails to make a POST request when the content type is set to application/json

I am utilizing jQuery version 1.10.1. My goal is to execute a POST request with the content type set to application/json. The code I have implemented is as follows: $.ajax({ type: "post", url: urlBase + "user/search", contentTy ...

Angular application hosted on Apache2 with SSL configured to communicate with a Spring Boot API running on port 8080

After developing a small application using Angular and an API with Spring Boot that includes an embedded Tomcat server, I decided to deploy them on a Raspberry Pi while configuring an SSL certificate with Let's Encrypt. The deployment process involved ins ...

Perform an ajax POST call to interact with a RESTful API

After completing a tutorial, I successfully created a PHP Slim framework based API that allows for user registration and login with authentication: URL /register Method POST Params name, email, password The '/register' call does not requi ...

The issue of Access-Control-Allow-Origin not functioning properly when using Ajax for a POST request

I am encountering an issue with the header "Access-control-allow-origin" when making a request using the following code: <script type='text/javascript'> function save() { $.ajax( { type: 'POST', ur ...

Securely verifying user identity across various domains using Cross-Origin Resource Sharing (CORS) in conjunction

I am trying to make a cross-origin XMLHttpRequest from domain1.com to domain2.com. domain2.com is a NextJS application that uses NextAuth for authentication. The issue I am facing is that when I send this request, the cookies from domain2 are not being in ...

Guide to creating a dynamic form using Phonegap and jQuery Mobile

Currently, I am working on an iPhone and Android app using Phonegap and jQueryMobile. The app receives a JSON with a form that was generated by my ruby on rails web application. However, I have encountered a significant issue. The form is quite large, con ...

Unable to communicate with MediaWiki API using jQuery

My attempt to retrieve content from Wikipedia in JSON format has been unsuccessful: $.getJSON("http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles="+title+"&format=json", function(data) { doSomethingWith ...

Chrome's Surprising Cross-Domain File URL Problem

Is anyone else experiencing the issue with Chrome throwing a Cross Domain Error when using file URLs? I'm trying to embed an SVG document into an HTML page using the object tag with a relative path in the data attribute. Upon the onload event, I need ...

Fetching Data Using Cross-Domain Ajax Request

Seeking assistance with a cross-domain Get request via Ajax. The code for my ajax request is as follows: var currency_path = "http://forex.cbm.gov.mm/api/latest"; $.ajax({ url: currency_path, crossDomain:true, type:"GET", dataTyp ...

Integrating domain name into a post request using React

Currently, I have a frontend (react, Node.js) and a backend Springboot hosted on the same remote hosting service at . The frontend and backend are placed in different environments but function well individually. I connected my frontend to a domain and up ...

Is it possible to observe cross-domain Javascript requests in Firebug or any alternative browser extension?

Is there a way to monitor cross-domain JavaScript requests made on a webpage? Is it possible with Firebug or any other plugin? Consider this scenario: If I visit stackoverflow.com and they incorporate an external JavaScript file (such as Google Analytics) ...

How to bypass CORS restrictions in XMLHttpRequest by manipulating HTTP headers?

Currently experimenting with the (deprecated) Twitter API 1.0 For instance, I am interested in retrieving data from the API utilizing AJAX browser requests on cross-origin web pages. This could be a new tab, a local HTML file, or any established website. ...

Passport.js securely manages cross-origin resource sharing (CORS) domain sessions

I've organized my application into a 3-tier structure. The server is powered by node.js and the front end is built with Angular. For user login and authentication, I'm using passport. However, I've encountered an issue where my passport login cannot mainta ...

Enhancing Angular2 authentication with Auth0 for enabling Cross-Origin Resource Sharing

I have been working on implementing user authentication through Auth0. I followed the instructions provided on their website, but I am encountering authentication issues. Whenever I try to authenticate, an error message appears in the console stating that ...

Access Denied: Phonegap Is Off Limits

I am in the process of developing an Android and iOS application. In order to accomplish this, I need to utilize cross-domain ajax requests since I am using Phonegap for development purposes. The issue I'm facing is as follows: when I access my server from ...

Utilize a separate domain for sections of the URL within CodeIgniter

I am interested in creating a website using CodeIgniter (CI) where users have their own personal page with a URL structure like this: main-domain.com/index.php/sites/site_id/other-controller... However, I also want to assign a unique domain for each user ...

Having trouble retrieving JSON with crossDomain jQuery AJAX

The process I followed was creating a rails 3.0 scaffold and exposing it using json, keeping it running. When accessing http://localhost:3001/objects.json I can view json data in the browser Next, I had a simple html file with code.jquery.com/jquery-1.7 ...

How to Ensure the Security of JSONP?

Currently, I have a script that utilizes JSONP for conducting cross domain ajax calls. While it is functioning effectively, I am pondering if there is a method to hinder other websites from accessing and retrieving data from these particular URLs. My goal ...

What is the method to retrieve content from a different domain using .load()?

When I try to retrieve data from a different domain using .load() or other jQuery ajax functions, it doesn't seem to work. However, accessing URLs on my own domain works perfectly fine. I've heard about a workaround involving PHP and setting up a proxy to ...

Pull data from another domain's DIV using jQuery's load/ajax function

I need to load content from a different domain into a DIV on my JSP page. For example: $("#myDiv").load("https://www.google.com") The issue I'm facing is that the request is being blocked by the browser's same origin policy. I've explored options like ...

Access-Control-Allow-Origin causing a one-of-a-kind session problem

When trying to access data using cross-domain requests from multiple domains, I have included the following code in a PHP file at the backend: header("Access-Control-Allow-Origin: *"); Each time a new session is created for every request, resulting in a ...

How does setting $.support.cors = true; affect the performance of ajax calls on browsers that do not support Cross-Origin Resource Sharing (

Hey everyone, I've encountered a situation where I need to make cross-domain AJAX requests, so I included the line "$.support.cors = true;" before my ajax calls. However, I'm noticing that for non-cross domain calls, my ajax requests don't seem to go thr ...

How is the same-domain policy applied to popup windows that have JavaScript enabled in the URL?

Is it possible to achieve something similar to this? var w = window.open("javascript: makeAnAjaxRequest();"); I'm curious whether the Ajax request, which is triggered after the new window is opened, would be considered a cross-site request. Does the same ...

Receiving errors from Jquery Ajax Calls

I have been attempting to retrieve an AJAX response from the following Twitter URL, but unfortunately, it keeps returning errors. I can't seem to figure out how to make it work. The URL in question is ? I have also tried adding a callback at the end, sus ...

The functionality of Embedded Jetty's org.eclipse.jetty.util.log.StrErrLog appears to be malfunctioning

My embedded Jetty setup using Jersey Moxy JSON support is working fine with @GET requests, but encountering issues with the single @PUT request I have as it never gets hit. Additionally, the cross-origin filter configured in web.xml doesn't seem to be func ...

What is the method for indicating the data type in an XDR request?

Currently, I am successfully using XDR for cross domain resource sharing in IE. However, I am facing an issue with specifying the return dataType to receive JSON as responseText. Below is the snippet of my code: if (window.XDomainRequest && $.browser.m ...

Implementing JSON methods in C# WebService to enable communication with external servers

Is it possible to integrate an asp.net web service written in C# into an HTML5/JavaScript website? The challenge is that the web service and client are located on different domains, requiring a cross-domain request. ...

Connecting different domains using AJAX

Is it possible to send an Ajax request to a separate server instance (running on a different port) on the same machine? ...

Using AngularJS service to perform a GET request

I'm just starting to learn about angularJS and I'm trying to understand how to make a GET request to an external server. The documentation provides an example request like this: Example Request curl -H 'Accept: application/vnd.twitchtv.v ...

Enabling external ajax requests in an Android Webview with jquery mobile capabilities

I am working on a javascript/HTML application using jquerymobile that makes ajax requests to a remote server. While the app functions properly in Chrome (with web security disabled), embedding it within the assets/ directory of an Android application (a ba ...

Leveraging JSONP, jQuery, and PHP for executing cross-domain AJAX requests

: html: <form id="myform"> <input id="inputfield" name="view"> </form> js: var inputdata = $('#inputfield').val('ocean-view'); $('#myform').submit(function(e) { e.preventDefault(); $.ajax({ ...

Leveraging AJAX for fetching files on the identical server

Just starting out with HTML and AJAX programming, so let's give it a shot: I've developed a website that populates a table with content from an external txt file (content.txt). The text file is hosted on a Windows 2003 webserver in the C:Inetpubwwwroot ...

Having Trouble with CORS when Sending a POST Request to Next.js 13.4.4 API Endpoint

I am currently using Next.js version 13.4.4 and have set up an endpoint at http://localhost:5000/logout. Within my src/app/logout/route.tsx file, the following code is present: import { NextRequest, NextResponse } from "next/server"; export asyn ...

Using jQuery to interact with a web service - overcoming cross-domain restrictions

Attempting to connect to a WCF service using a jQuery client. Referencing this specific example: http://www.codeproject.com/KB/aspnet/WCF_JQUERY_ASMX.aspx#4 Everything functions properly when the client webpage is on the same domain as the service. Howe ...

Perform an ajax POST call to a server using ajax/jQuery techniques

I am attempting to utilize ajax to send a post request to a different domain and receive a json response. The server is located within my company premises and the logs show that it is indeed sending back a json response. Below are two samples of my attemp ...

Utilizing Cookies in an AJAX Request for Cross-Domain Communication with Pure Javascript

I am in the process of developing an Analytics application and I'm seeking a method to uniquely identify each user's device. Currently, my approach involves generating a "cookie" from the server side to track all page clicks and interactions thro ...

When attempting to access the requested resource in AngularJS, there is no 'Access-Control-Allow-Origin' header present

When attempting to run my web-service from within my code, I encounter the following error message: "XMLHttpRequest cannot load http://mywebservice. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http:/ ...

Switching from using jQuery's $.ajax method to Angular's $http service

I have been working on a jQuery code snippet that works seamlessly across different origins: jQuery.ajax({ url: "http://example.appspot.com/rest/app", type: "POST", data: JSON.stringify({"foo":"bar"}), dataType: "json", contentType: "a ...

Determine if the same origin policy is in effect

Is there a method to determine if the same origin policy is applicable to a URL before attempting to use ajax methods? Below is an example of what I currently have: function testSameOrigin(url) { var loc = window.location, a = document.create ...

Get the contents inside the window.open using Javascript

First and foremost, I want to acknowledge that I understand the likelihood of this failing due to cross-domain restrictions - just seeking confirmation on that. Here's my approach: I have a window that I open using JavaScript. Subsequently, I make an Ajax ...

A Complication Arises with Browser Functionality When Embedding an Iframe within

I am experiencing a peculiar problem while embedding an iframe with a specific src inside an absolutely positioned div. Here's the basic structure of the webpage: .container { position: relative; overflow: hidden; width: 100%; height: 10 ...

Communication between the Node development server and the Spring Boot application was hindered by a Cross-Origin Request

Here is the breakdown of my current setup: Backend: Utilizing Spring Boot (Java) with an endpoint at :8088 Frontend: Running Vue on a Node development server exposed at :8080 On the frontend, I have reconfigured axios in a file named http-common.js to s ...

Uploading files with jQuery AJAX across different domains

What I'm facing is an issue with uploading files to a subdomain that serves as an API endpoint for file uploads. Every time I try to upload a file using jQuery from the main www domain to this subdomain, I encounter an error. XMLHttpRequest cannot ...

Internet Explorer 9 terminates POST requests using XDomainRequest

I have been implementing a cross-domain Ajax call in my project. Here is the code snippet I used: if (window.XDomainRequest) // Checking if XDR is supported by the browser. { xdr = new XDomainRequest(); // Creating a new XDR object. if (xdr) { ...

Solving CORS issues on an emulator with Ionic3 and Angular4

I'm currently testing my Ionic 3 app on a Genymotion emulator and running into an issue with HTTP requests due to CORS. Initially, I believed it was a server problem but after checking the same server with an Ionic 2 app, everything seemed fine. Surprising ...

dealing with a straightforward cross-domain problem in Heroku using Node.js

I recently worked on developing two node.js applications, namely: webprocess dataprocess The dataprocess application returns a REST message with the following code snippet: var status = 200; if (responseStatus) { status = responseStatus; } var conte ...

Error encountered when attempting an ajax call across different origins

function fetchInfo() { var endpointUrl = "https://api-oauth2.mendeley.com/oauth/authorize?client_id=374&redirect_uri=https://localhost/api/mendeley/mendeley.php&response_type=code&scope=all&JSON=1"; $.ajax({ url: endpointUr ...

Exploring cross-domain loading and AJAX with JQuery

My process for loading items on is as follows: Starting with JQuery via Google API Next, I load two global functions from another domain: loadcrossdomain (using getJSON via query.yahooapis) and a simple function for URL parsing Inclusion of Googl ...

How to integrate JavaScript code into an Android Native app

I have encountered a peculiar issue that I am keen to resolve. Currently, I am working on a proof of concept where I need to verify if a certain setup would function as intended. The Android app's user interface is built natively using Java and XML layout ...

Swap out the image for a div element if the image is not found

Is there a way to accurately display an image if it's available, and use a div as a replacement if the image is not present? // How can I determine `imageExists` without encountering cross-origin issues? (imageExists) ? (<img class="avatar-img" sr ...

VueJS is unable to access the requested resource due to the absence of an 'Access-Control-Allow-Origin' header

Currently, I am working on a VueJS application that requires calling an external API. The code snippet below demonstrates my approach: this.$http.get(myAPIurl) .then(response => { return response.json(); ...