fetch file on server using jquery

Solutions on MaxInterview for fetch file on server using jquery by the best coders in the world

showing results for - "fetch file on server using jquery"
Samuel
18 Aug 2016
1$.get(url)
2    .done(function (responseText) {
3  		// things to do when file is found and use below condition
4  		//	if only the server redirection is on    
5  			a = responseText
6            if (a.search("a sample string from response html") < 0) {
7              // thing to do when file is found and not redirected
8            } else {
9              // thing to do when file is not found and redirected
10            }
11    }).fail(function () { // Network error
12});