1

I have Jquery Code Sample.Here I need to put the content of one page inside a particular div

 var ajax_load = "<img src='ajax-loader.gif'  alt='loading...'>";
     $('#id').html(ajax_load).load("https://url/demo/Sample"); 

Due to CORS my code is not working.In my server CORS is enable but request is not coming to server also,How to handle the issue,

If I am trying the same with normal Html (From Same Domain )I am not getting it correctly

Linguistic
  • 73
  • 2
  • 5
  • CORS **relaxes** security restrictions. It shouldn't be able to prevent your code from working (although the lack of it could). What makes you think CORS is causing your problem? What error message are you getting? – Quentin Nov 11 '14 at 06:11
  • Can you open javascript debugger and see what error that appear? – Jon Kartago Lamida Nov 11 '14 at 06:11
  • possible duplicate of [CORS jQuery AJAX request](http://stackoverflow.com/questions/20442628/cors-jquery-ajax-request) – Andreas Nov 11 '14 at 06:11
  • Hi @Jon Kartago Lamida This is the error I am getting :::::: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://url I am requesting//Sample. This can be fixed by moving the resource to the same domain or enabling CORS. Sample – Linguistic Nov 11 '14 at 06:20
  • I am requesting a Jsp Page Sample is the URL mapping for my JSP Page. – Linguistic Nov 11 '14 at 06:24
  • @AAAAAA — That error message says the problem is that CORS is not enabled. Its entirely the opposite to the problem you said you had. – Quentin Nov 11 '14 at 06:28
  • Duplicate of [Ways to circumvent the same-origin policy](http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy). – Quentin Nov 11 '14 at 06:29

0 Answers0