bambinou
04-12-2010, 10:52 AM
Hi,
Any idea how to rectify this problem please?
When I try to submit a comment on my site, there is a runtime error detected by IE but it works fine in Firebox.
IE says that the formvalidation.js file has a runtime error, I cannot find out what.
Please Help,
Thank you,
BamBam,
Here is the code:
//this function create XML HTTP Request object for ajax
function createXmlHttpRequestObject()
{
// will store the reference to the XMLHttpRequest object
var xmlHttp;
// if running Internet Explorer
if(window.ActiveXObject)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
xmlHttp = false;
}
}
// if running Mozilla or other browsers
else
{
try
{
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
xmlHttp = false;
}
}
// return the created object or display an error message
if (!xmlHttp)
alert("Error creating the XMLHttpRequest object.");
else
{
//checkLogin(xmlHttp)
return xmlHttp;
}
}
var http=createXmlHttpRequestObject();
var advertisement_link_global="";
function addClickedAdvertisementDetail(banner_id,ad_id,link,type)
{
advertisement_link_global=link;
var url='add_advertise_detail_ajax.php?banner_id='+banner_id+'&ad_id='+ad_id+'&type='+type;
http.open("GET",url,true);
if(type=="Click")
{
http.onreadystatechange = handleHttpResponseAdvertisement;
}else
{
http.onreadystatechange = handleHttpResponseAdvertisementForView;
}
http.send(null);
}
function handleHttpResponseAdvertisement()
{
if(http.readyState == 4 )
{
if(http.status == 200 )
{
var res=http.responseText;
setTimeout("",2000);
window.location=advertisement_link_global;
}
else
{
//alert(http.status);
}
}
return;
}
function handleHttpResponseAdvertisementForView()
{
if(http.readyState == 4 )
{
if(http.status == 200 )
{
var res=http.responseText;
}
else
{
//alert(http.status);
}
}
return;
}
function addUserCommentAjax(start)
{
formobj=document.userComment;
var user_comment=formobj.user_comment;
var comment_user_type=formobj.comment_user_type;
var comment_user_id=formobj.comment_user_id;
var comment_artist_id=formobj.comment_artist_id;
var validationcode=formobj.validationcode;
var user_action="Add";
var url='ajax_user_comment.php';
var params = 'action='+user_action+
'&user_type='+comment_user_type.value+
'&user_id='+comment_user_id.value+
'&artist_id='+comment_artist_id.value+
'&comment='+user_comment.value+
'&validationcode='+validationcode.value+
'&start='+start;
http.open("POST",url,true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = handleHttpResponseAddUserComment;
http.send(params);
}
function handleHttpResponseAddUserComment()
{
if(http.readyState == 4 )
{
if(http.status == 200 )
{
var res=http.responseText;
document.getElementById('hid_div_user_comment').innerHTML=res;
if(eval(document.getElementById('div_error_user_comment')))
{
document.getElementById('div_comment_status_msg').innerHTML=document.getElementById('div_error_user_comment').innerHTML;
}
if(eval(document.getElementById('div_error_imageverify')))
{
//alert(document.getElementById('span_imagevarify').innerHTML);
//document.getElementById('span_imagevarify').innerHTML=document.getElementById('div_error_imageverify').innerHTML;
//alert(document.getElementById('span_imagevarify').innerHTML);
frame_img_varify.document.location.reload();
document.getElementById('div_comment_status_msg').innerHTML=document.getElementById('div_error_user_comment').innerHTML;
}else if(eval(document.getElementById('div_ajax_user_comment')))
{
if(eval(document.getElementById('span_ajx_commnet_cnt')))
{
if(eval(document.getElementById('div_comment_cnt')))
{
document.getElementById('div_comment_cnt').innerHTML=document.getElementById('span_ajx_commnet_cnt').innerHTML;
}
}
if(document.getElementById('user_comment').value != '')
{
frame_img_varify.document.location.reload();
}
document.getElementById('validationcode').value='';
document.getElementById('div_user_comments').innerHTML=document.getElementById('div_ajax_user_comment').innerHTML;
document.getElementById('user_comment').value='';
document.getElementById('div_comment_status_msg').innerHTML=document.getElementById('div_error_user_comment').innerHTML;
}
}
else
{
alert(http.status);
}
}
return;
}
Any idea how to rectify this problem please?
When I try to submit a comment on my site, there is a runtime error detected by IE but it works fine in Firebox.
IE says that the formvalidation.js file has a runtime error, I cannot find out what.
Please Help,
Thank you,
BamBam,
Here is the code:
//this function create XML HTTP Request object for ajax
function createXmlHttpRequestObject()
{
// will store the reference to the XMLHttpRequest object
var xmlHttp;
// if running Internet Explorer
if(window.ActiveXObject)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
xmlHttp = false;
}
}
// if running Mozilla or other browsers
else
{
try
{
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
xmlHttp = false;
}
}
// return the created object or display an error message
if (!xmlHttp)
alert("Error creating the XMLHttpRequest object.");
else
{
//checkLogin(xmlHttp)
return xmlHttp;
}
}
var http=createXmlHttpRequestObject();
var advertisement_link_global="";
function addClickedAdvertisementDetail(banner_id,ad_id,link,type)
{
advertisement_link_global=link;
var url='add_advertise_detail_ajax.php?banner_id='+banner_id+'&ad_id='+ad_id+'&type='+type;
http.open("GET",url,true);
if(type=="Click")
{
http.onreadystatechange = handleHttpResponseAdvertisement;
}else
{
http.onreadystatechange = handleHttpResponseAdvertisementForView;
}
http.send(null);
}
function handleHttpResponseAdvertisement()
{
if(http.readyState == 4 )
{
if(http.status == 200 )
{
var res=http.responseText;
setTimeout("",2000);
window.location=advertisement_link_global;
}
else
{
//alert(http.status);
}
}
return;
}
function handleHttpResponseAdvertisementForView()
{
if(http.readyState == 4 )
{
if(http.status == 200 )
{
var res=http.responseText;
}
else
{
//alert(http.status);
}
}
return;
}
function addUserCommentAjax(start)
{
formobj=document.userComment;
var user_comment=formobj.user_comment;
var comment_user_type=formobj.comment_user_type;
var comment_user_id=formobj.comment_user_id;
var comment_artist_id=formobj.comment_artist_id;
var validationcode=formobj.validationcode;
var user_action="Add";
var url='ajax_user_comment.php';
var params = 'action='+user_action+
'&user_type='+comment_user_type.value+
'&user_id='+comment_user_id.value+
'&artist_id='+comment_artist_id.value+
'&comment='+user_comment.value+
'&validationcode='+validationcode.value+
'&start='+start;
http.open("POST",url,true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = handleHttpResponseAddUserComment;
http.send(params);
}
function handleHttpResponseAddUserComment()
{
if(http.readyState == 4 )
{
if(http.status == 200 )
{
var res=http.responseText;
document.getElementById('hid_div_user_comment').innerHTML=res;
if(eval(document.getElementById('div_error_user_comment')))
{
document.getElementById('div_comment_status_msg').innerHTML=document.getElementById('div_error_user_comment').innerHTML;
}
if(eval(document.getElementById('div_error_imageverify')))
{
//alert(document.getElementById('span_imagevarify').innerHTML);
//document.getElementById('span_imagevarify').innerHTML=document.getElementById('div_error_imageverify').innerHTML;
//alert(document.getElementById('span_imagevarify').innerHTML);
frame_img_varify.document.location.reload();
document.getElementById('div_comment_status_msg').innerHTML=document.getElementById('div_error_user_comment').innerHTML;
}else if(eval(document.getElementById('div_ajax_user_comment')))
{
if(eval(document.getElementById('span_ajx_commnet_cnt')))
{
if(eval(document.getElementById('div_comment_cnt')))
{
document.getElementById('div_comment_cnt').innerHTML=document.getElementById('span_ajx_commnet_cnt').innerHTML;
}
}
if(document.getElementById('user_comment').value != '')
{
frame_img_varify.document.location.reload();
}
document.getElementById('validationcode').value='';
document.getElementById('div_user_comments').innerHTML=document.getElementById('div_ajax_user_comment').innerHTML;
document.getElementById('user_comment').value='';
document.getElementById('div_comment_status_msg').innerHTML=document.getElementById('div_error_user_comment').innerHTML;
}
}
else
{
alert(http.status);
}
}
return;
}
