1
var x;
function addtoDom() {
console.log("Adding to DOm");
$("#capt").html('<div id="mduit"><img src="captcha1.jpg"></div>');
}
function request() {
$.ajax({
url: "mudit.php",
type: "GET",
success: function (data) {
console.log(data);
x = data;
addtoDom();
}
});
}
request();
Mudit.php放在这里阿贾克斯要求越来越失败
<?
// header("Content-type:image/jpeg");
session_start();
$img = imagecreate(150,60);
imagecolorallocate($img,200,255,200);
$abc = rand();
while ($abc < 10000) {
$abc = rand();
}
$_SESSION['Captcha_num'] = $abc;
imagettftext($img,35,0,0,40, 89,"abcd.ttf", $abc);
imagejpeg($img,"captcha1.jpg",65);
echo $abc;
?>
这里的代码工作在铬罚款,但在Firefox不工作。 即刷新点击刷新按钮上的图像.. captcha刷新铬铬 但不是在Firefox。
“mudit.php” <? header(“Content-type:image/jpeg”); session_start(); $ img = imagecreate(150,60); imagecolorallocate($ img,200,255,200); $ abc = rand(); ($ abc <10000) { $ abc = rand(); \t } $ _SESSION ['Captcha_num'] = $ abc; imagettftext($ img,35,0,0,40,89,“abcd.ttf”,$ abc); imagejpeg($ img,“captcha1.jpg”,65); echo $ abc; ?> –
尝试用''''。 –
php中的worng是什么? –