Dear Friends ,
I am new in ajax .Follwoning code give error -
Error: this.ajaxobj has no properties
Source File: http://localhost/ajax/ajaxroutine.js
Line: 39
line 39 is
if(this.ajaxobj .readyState==4)
i donot understand that why its give error because i am working on current object which is defined earlier .
Gunjan
I am new in ajax .Follwoning code give error -
Code:
var ajaxpack=new Object()
ajaxpack.basedomain="http://"+window.location.hostname
ajaxpack.ajaxobj=createAjaxObj()
ajaxpack.filetype="txt"
ajaxpack.addrandomnumber=0 //Set to 1 or 0. See documentation.
ajaxpack.getAjaxRequest=function(url, parameters, elemid, filetype){
ajaxpack.ajaxobj=createAjaxObj() //recreate ajax object to defeat cache problem in IE
if (ajaxpack.addrandomnumber==1) //Further defeat caching problem in IE?
var parameters=parameters+"&ajaxcachebust="+new Date().getTime()
if (this.ajaxobj){
this.filetype=filetype
this.ajaxobj.onreadystatechange=function()
{
if(this.ajaxobj.readyState==4)
{
document.getElementById(elemid).innerHTML=this.ajaxobj.responseText;
}
}
this.ajaxobj.open('GET', url+"?"+parameters, true)
this.ajaxobj.send(null)
}
}
Error: this.ajaxobj has no properties
Source File: http://localhost/ajax/ajaxroutine.js
Line: 39
line 39 is
if(this.ajaxobj .readyState==4)
i donot understand that why its give error because i am working on current object which is defined earlier .
Gunjan
Comment