AJAX & JQuery 1.calling a jsp page by passing parameter $.ajax({ url: 'data.jsp?parameter=sahitya', async: false, error: function() { alert("Error"); }, success: function(data) { alert(data); } }); 2.checking weather string contains "/" or not if (data.toLowerCase().indexOf("/") >= 0) { } 3.Redirecting the url to some other var path=location.protocol + "//" + location.host+data ;//gives the base path window.location=path; Here var pathname = window.location.pathname; // Returns path only var url = window.location.href; // Returns full URL ...
Posts
Showing posts from February, 2015