Answers for "fetch file on server using jquery"

0

fetch file on server using jquery

$.get(url)
    .done(function (responseText) {
  		// things to do when file is found and use below condition
  		//	if only the server redirection is on    
  			a = responseText
            if (a.search("a sample string from response html") < 0) {
              // thing to do when file is found and not redirected
            } else {
              // thing to do when file is not found and redirected
            }
    }).fail(function () { // Network error
});
Posted by: Guest on August-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language