aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes cross domain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "cross domain" Watch "cross domain" New topic
Author

cross domain

fairoz khan
Greenhorn

Joined: Aug 03, 2012
Posts: 8
Hi Friends,

My local:
i am calling one webservice url from normall html page. In my local its working fine without any IE settings.(environment is windows xp).But in my system Miscellaneous is disable in IE.

other machine:
when i am calling same url from sharepoint(using same code) i am facing error. (access-control-allow-origin domain).To reslove error i did below IE settings.(environment is window 7)

settings:Click the “Security” tab. Click the “Internet” icon, then click the “Custom Level” button. Scroll down to the “Miscellaneous”(enable it) section of the list in the Settings pane.

then its working in sharepoint.

my code:
$(document).ready(function() {

alert("kdfj");
var url="https://maps.googleapis.com/maps/api/geocode/json?address=bangalore&sensor=false";
$.ajax({

//cache: true,
dataType: "json",
crossDomain:true,
contentType:"application/json",
headers:{
Accept:"application/json",
"Access-Control-Allow-Method":"*"
},
type: "GET",
url: url,
success: function(jsonp) {
alert(jsonp);





}
});


});

But i dont want to do manually settings in IE.

is it possible to Enable to Miscellaneous from javascript or jquery or i want to do any changes in my code.

Thanks in advance.

Fairoz p.

Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 295
    
    5

Fix this from the server side by adding the access-control-allow-origin header mentioned in the error message.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cross domain