You need to sign in to do that
Don't have an account?
Varun Chopra
Ajax call on visualforce page
Hi I am triying to run ajax on my visualforce page. But I am getting ready state= 0.
In chrome I was getting following error.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Here is my code
In chrome I was getting following error.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Here is my code
$.ajax({ type:"GET", url:'https://www.foragentsonly.com/', dataType:"html", beforeSend: function(xhr) { xhr.setRequestHeader('X-User-Agent', 'MyClient'); }, success:function(data) { alert(data); }, error:function(errorStatus,xhr) { alert("Error"+JSON.stringify(errorStatus)); } }); // document.getElementById('theIframe').src = url; }
Try it.