hi there i have a registration page on which i have a captcha verification method i customized that code for the sake that the user is able to refresh the captcha images by staying on the same page via AJAX ,now the code i have written works perfect in IE6 , the user clicks the Refresh button and the new images is populated but when using FIREFOX it is doing nothing, i have placed the Captcha Image inside a div and on getting response(the new image) i throw that text inside the div via innerHTML but i is not replacing the image in FIREFOX ALTHOUGH THERE IS NO ERROR IN THE JAVASCRIPT AND THE FIRBUG SHOWS THE RESPONSED IMAGE TAG i tried to replace the image src also rather than overwriting the innerHTML of the div by splitting the response but still no use for that
i have to upoload that site today i am in a mess really the cross browser issues making me sick :s the code is here
filename=resist ration.php
[CODE=javascript]
<script type="text/javascript" language="javas cript">
function ref_captcha(){
refCapObj=GetXm lHttpObject();
var url="img_refres h.php";
if(refCapObj==n ull){
alert("you need to upgrade your browser");
return;
}else{
refCapObj.onrea dystatechange=s t_captcha;
refCapObj.open( "GET",url,true) ;
refCapObj.send( null);
}
}
function st_captcha(){
if(refCapObj.re adyState==4){
if(refCapObj.st atus==200){
document.getEle mentById("captc ha_img").innerH TML=refCapObj.r esponseText;
}
}
}
</script>
[/CODE]
[code=html]
<tr>
<td align="left" valign="middle" >
<div id="captcha_img ">
<img src="captcha/captcha.php?.jp g" alt="If Image is not showing, refresh this page" />
</div>
</td>
<td align="center" valign="bottom" width="200" class="text_gre y_12">
<div id="ref_captcha " style="cursor:p ointer;" onmouseover="ld _img();" onmouseout="unl d_img();" onclick="ref_ca ptcha();">
<div id="ref_img"></div>Refresh Image</div>
</td>
</tr>
[/code]
filename="img_r efresh.php"
[code=php]
<?
echo "<img src='captcha/captcha.php?.jp g' alt='If Image is not showing, refresh this page' />";
?>
[/code]
i have to upoload that site today i am in a mess really the cross browser issues making me sick :s the code is here
filename=resist ration.php
[CODE=javascript]
<script type="text/javascript" language="javas cript">
function ref_captcha(){
refCapObj=GetXm lHttpObject();
var url="img_refres h.php";
if(refCapObj==n ull){
alert("you need to upgrade your browser");
return;
}else{
refCapObj.onrea dystatechange=s t_captcha;
refCapObj.open( "GET",url,true) ;
refCapObj.send( null);
}
}
function st_captcha(){
if(refCapObj.re adyState==4){
if(refCapObj.st atus==200){
document.getEle mentById("captc ha_img").innerH TML=refCapObj.r esponseText;
}
}
}
</script>
[/CODE]
[code=html]
<tr>
<td align="left" valign="middle" >
<div id="captcha_img ">
<img src="captcha/captcha.php?.jp g" alt="If Image is not showing, refresh this page" />
</div>
</td>
<td align="center" valign="bottom" width="200" class="text_gre y_12">
<div id="ref_captcha " style="cursor:p ointer;" onmouseover="ld _img();" onmouseout="unl d_img();" onclick="ref_ca ptcha();">
<div id="ref_img"></div>Refresh Image</div>
</td>
</tr>
[/code]
filename="img_r efresh.php"
[code=php]
<?
echo "<img src='captcha/captcha.php?.jp g' alt='If Image is not showing, refresh this page' />";
?>
[/code]
Comment