javascript - Web application stops after console warning -
i facing problem in web application. whenever 592 console messages not shown. in console window, stops application. not move next.
at starting 1 more warning there synchronous xmlhttprequest on main thread deprecated because of detrimental effects end user's experience. more help, check http://xhr.spec.whatwg.org/.
would please suggest why warning happened , solution this.
let's go point point,
synchronous xmlhttprequest on main thread deprecated because of detrimental effects end user's experience.
this warning comes when try make synchronous ajax call. might have use either simple xmlhttprequest object or jquery make ajax call. why synchronous ajax calls deprecated? read 'async' attribute explanation of 'open' method here.
simple xmlhttprequest object
var xmlhttp = new xmlhttprequest(); xmlhttp.open("get","ajax_info.txt",**true**); // definition: open(method,url,async) xmlhttp.send();
using jquery,
$.ajax({ type: "post", url: "/page/method", contenttype: "application/json", data: json.stringify({ parametername: paramvalue }), async: **true** })
coming error message - 'failed load resource', loud , clear jquery lib file not found on server. fix path or make sure resource available on server @ requested location.
Comments
Post a Comment