我getResult()每次都调用该函数res.reply = 2,但有些情况res是空的.当console.log("error")调用返回值为空时.这适用于旧版本的jQuery Mobile.现在版本是1.3.2.
function getResult()
{
request = $.ajax({
type: "POST",
url: url,
dataType: "json",
data: {
....
},
error: function() {
console.log("error");
},
success: function(res) {
if(res.reply=='2') {
getResult();
}
}
});
}
Run Code Online (Sandbox Code Playgroud) 我正在使用控制器在用户更改网站语言后重定向.
return $this->redirect($this->generateUrl($_redirectTo), 301);
Run Code Online (Sandbox Code Playgroud)
问题是,显示"重定向到/ path /"的消息,我不想这样做.是否可以更改该消息?
有图像生成器的一些问题.也许你会发现问题是什么?我得到:"图像无法显示,因为它包含错误",我正在下载图像文件,但没有错误.
<?php
if(isset($_GET['id']) && $_GET['id']){
// require('../libs/global.inc.php');
$id = $_GET['id'];
$imagePath = "gov_220.jpg";//$track->getImg($id);
$framePath = "otgFrame.png";
$fontsize = 14;
$font = 'times.ttf';
$artistName = "bla bla";//$view->CutTheName("by ".$track->getArtist($id), 16);
//$artistName = iconv(mb_detect_encoding($artistName, mb_detect_order(), true), "UTF-8", $artistName);
$trackName = "la la";//$view->CutTheName($track->getName($id),16);
$photo = imagecreatefromjpeg($imagePath);
$w = imagesx($photo);
$h = imagesy($photo);
$new_image = imagecreatetruecolor(200, 200);
imagecopyresampled($new_image, $photo, 0, 0, 0, 0, 200, 200, $w, $h);
imagealphablending($new_image,true);
$frame = imagecreatefrompng($framePath);
imagecopy($new_image,$frame,0,0,0,0,200,200);
$fontcolor = imagecolorallocate($new_image, 255, 255, 255);
imagettftext($new_image, $fontsize, 0,2,177,$fontcolor, $font, $trackName );
$fontcolor …Run Code Online (Sandbox Code Playgroud) 今天早上有一个脑衰退的时刻.我有以下PHP:
$imgset = $result->fields[6];
if ($imgset = '')
{
$imgset = 'logo';
}
else
{
$imgset = $result->fields[6];
}
echo '<img id="imgdisp" src="/img/'.$imgset.'.jpg" />';
$imgset = '';
Run Code Online (Sandbox Code Playgroud)
在哪里查看数据库的结果是否为空白,如果是,则应该放入logo.jpg而不是结果.出于某种原因,它只是不想工作,我可能完全失明,但不明白为什么不.我仍然在HTML和文件名"/img/.jpg"中得到空白图片,好像$ imgset仍在传递空白.SQL中的值也不是NULL,它们绝对是在其他地方使用_POST从输入框输入的空白条目.
欢呼任何帮助
本