本文实例讲述了jQuery 图片查看器插件 Viewer.js用法。分享给大家供大家参考,具体如下:
html:
js:
html += " ";
//查看图片
function viewPhotos(ot_id) {
var Html = "";
$.ajax({
type: "post",
async: false,
dataType: "json",
url: "/order/order/get-list",
data: {
ot_id: ot_id,
type: 1
},
success: function (json) {
if (json.ask) {
Html += "| "; }); } else { Html += " | "; } Html += " |
Controller:
class Order_OrderController extends Zend_Controller_Action {
public function getListAction () {
$type = $this->_request->getParam('type', 0);
$otId = $this->_request->getParam('ot_id');
if ($type) {
$otIds = Order_Service_Transport::getByOtId($otId);
if ($otIds) {
$images = explode(';', $otIds['images']);
$data = array();
foreach ($images as $value) {
$data[] = $value;
}
$return['ask'] = 1;
$return['data'] = $data;
} else {
$return['ask'] = 0;
$return['msg'] = '未获取到对应图片';
}
die(json_encode($return));
}
}
}
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery切换特效与技巧总结》、《jQuery遍历算法与技巧总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。



