Posts

Showing posts from February, 2015
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 The window.location read-only property returns a Location object with information about the current location of the document. Ex: http://www.Sample.com:8082/index.php#tab2?foo=123 Property