Php yii和jquery移动
我在Php yii和jquery移动,php,jquery,jquery-mobile,mobile,yii,Php,Jquery,Jquery Mobile,Mobile,Yii,我在Yii和jQuery手机方面有问题。问题是jQuerymobile只使用rel=“external”链接中的js文件,这些文件位于div中的data role=“page”Yii在div末尾或标头中生成活动表单js 我试着把 <script src='lala/js.js' type = "text/javascipt"></script> 问题是我想使用Yii函数来添加css和js。 有什么解决方案吗?核心问题是jquery mobile不包含任何在page di
Yii
和jQuery
手机方面有问题。问题是jQuery
mobile只使用rel=“external”
链接中的js文件,这些文件位于div中的data role=“page”
Yii
在div末尾或标头中生成活动表单js
我试着把
<script src='lala/js.js' type = "text/javascipt"></script>
问题是我想使用Yii
函数来添加css和js。
有什么解决方案吗?核心问题是jquery mobile不包含任何在page div之外返回的内容 解决方法是像通常一样使用registerScript等,然后$markup=$this->render('view,$params,true,true);然后,您可以在jquery移动页面中回显完整的标记(使用脚本)
PS:JQuery Mobile中正在进行一些更改,删除了使用div data role=page包装页面的要求。Beta2有这个功能,但它似乎被窃听了。您尝试过Yii函数()吗?我不知道为什么你不能让这些工作。所以,这不起作用。我觉得我使用了jquery mobile通过ajax获得的html,并手动解析它,这让我找到了正确的方向:
$markup='';Yii::app()->clientScript->render($markup);echo($标记)代码>
$('div').live('pagebeforeshow', function(event, ui){
$("head").append("<link>");
css = $("head").children(":last");
css.attr({
rel: "stylesheet",
type: "text/css",
href: "/site/css/mobile/mobile.css"
});
$.getScript("/site/js/fancyForm_qe.js", function(){
//some other stuff
);
});
$('.successMessage').hide();
});