Here my ajax request and response,I have around 85 HTML pages with same ajax request.When i work with these files sometimes im getting following error
AJAX
$(document).ready(function(){
localStorage.setItem('currentPageNo', 9);
ResetSwiper();
CheckPageReadCompleted();
extrapopuptrigger("1");
});
function ResetSwiper() {
toggle_text = localStorage.getItem("currentBibleVersion");
myView = $(".scrollpane").data("mobileIscrollview");
if(toggle_text == "ESV") {
$(".searchContent").hide();
$(".esvContent").show();
setTimeout(function() {
var text_search = null;
$(".esvContent").html('Loading...');
text_search = $(".searchTitle").html();
xhr = $.ajax({
type: "GET",
url: "http://www.esvapi.org/v2/rest/verse?key=IP&passage="+text_search+"&include-footnotes=false",
data:"",
contentType: "text/html",
dataType: "text",
cache: false,
async: true,
crossDomain: true,
success: function(resp) {
$(".esvContent").html(resp);
setTimeout(function() {
if(myView != null || myView != 'undefined') {
myView.refresh();
}
},100);
},
error: function(err) {
var is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);
if(is_uiwebview) {
natviveAlert("StandFIRM","Unable to connect internet.Please try again!");
} else {
window.JSInterface.showAlertDialog("StandFIRM","Unable to connect internet.Please try again!");
}
}
},100);
});
} else{
$(".esvContent").hide();
$(".searchContent").show();
myView.refresh();
}
}
How can i solve this issue?Can any one please help me to solve