Below are some JavaScript functions:
//function to get element by id
function getElementByIdCustom(x){
return document.getElementById(x);
}
//ajax request handling without jQuery
function createXMLHttpRequestObject( method, url ) {
var xhr = new XMLHttpRequest();
xhr.open( method, url, true );
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
return xhr;
}
function checkAjaxResponse(xhr){
if(xhr.readyState == 4 && xhr.status == 200){
return true;
}
}
Any tips on handling browser compatibility issues without relying on jQuery?