PM's Blog

Pramod Mohanan's notes about ASP.NET, MVC, C#, SQL, jQuery, Bootstrap


Cross Domain Ajax using jQuery

Browsers by default don’t allow cross domain ajax. Conceptually we can implement JSONP (see using jquery to do this. Here is an example <script type="text/javascript"> $(document).ready(function () {    var s = $.ajax({ url: "", context: document.body, dataType: "jsonp" }); }); function populate(data) {   $(".info").html(unescape(data)); } </script> <button id="btn" value="click me" /> <div […]

Cross domain Ajax Queries

Cross domain Ajax queries are not allowed as per w3c scripting standards and attempts to do that will result in browsers restricting such scripts to run raising exceptions with messages like “Origin null is not allowed by Access-Control-Allow-Origin” or “Access to restricted URI denied” A widely used work around to handle Cross domain Ajax queries […]

PM's Blog © 2018