user3168426 user3168426 - 1 year ago 61
jQuery Question

No 'Access-Control-Allow-Origin' header is present on the requested resource

<!DOCTYPE html>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>webservices example </title>
<link rel="stylesheet" href="" />
<link rel="stylesheet" href="my.css" />
<script src=""></script>
<script type="text/javascript">
$(document).ready(function() {
crossDomain: true,
contentType: "application/json; charset=utf-8",

dataType: "json",
xhrFields: {

withCredentials: true
beforeSend: function (request) {

request.setRequestHeader("Access-Control-Allow-Origin: ", "*")
success: function(data) {
error: function(data) {
alert("Error in Processing-----" + data.status);


" XMLHttpRequest cannot load{}. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://:8088' is therefore not allowed access".

Answer Source

you are trying to perform XMLHttpRequest(AJAX) to another domain.

This is restricted due to security reasons.

for more details see: