comparison interface/js/check_sections_details.js @ 3:f196939ccc03

error handle and alert feedback to user. If error occurs, user'll not be halted by the loading page and sections_revisions will recovery to previous version.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 26 Jan 2015 12:19:39 +0100
parents ef6d0c6a13d7
children
comparison
equal deleted inserted replaced
2:da5309d54083 3:f196939ccc03
316 var count=reg.exec(href); 316 var count=reg.exec(href);
317 reg = /[^\?]+/g; 317 reg = /[^\?]+/g;
318 href = reg.exec(href); 318 href = reg.exec(href);
319 href=href+"?book_id="+bookId+"&"+count+"&hideDeletedChecked="+hideDeletedChecked+"&editor="+editor; 319 href=href+"?book_id="+bookId+"&"+count+"&hideDeletedChecked="+hideDeletedChecked+"&editor="+editor;
320 location.href=href; //refresh the page to load the sections saved in db 320 location.href=href; //refresh the page to load the sections saved in db
321
321 }else{ 322 }else{
322 console.log("db not succeeded."); 323 console.log("db failed. log: ", data);
324 alert("Saving failed. You've NOT saved your editing.");
325 alert("Please check your editing again. If the issue remains, please contact us.");
326 $("#loading").hide();
323 327
324 } 328 }
325 }, 329 },
326 "json" 330 "json"
327 ); 331 );