Syntax considerations for registerScript in Yii_PHP tutorial

WBOY
Release: 2016-07-14 10:10:36
Original
1143 people have browsed it

The name of autoLoad cannot be repeated with other scripts!
Do not use comments such as //
Embed PHP variable: '".$params['sdate']."'
The Value in HTML must be double quoted, and the meaning must be changed! ! ! !


Yii::app()->clientScript->registerScript('autoLoad', "
var status= '".$params['type']."';
var sdate = '".$params['sdate']."';
var edate = '".$params['edate']."';
var word = '".Yii::app()->request->getParam('word')."';
$('#ShopInfo_shop_products').val(word);
if(status == 'osub') {
$('#shop_launch_start_time').val(sdate);
$('#shop_launch_end_time').val(edate);
$.fn.yiiGridView.update('report-grids', {
          data: $('#form').serialize()
});
}

var currentUser = '".Yii::app()->user->getName()."';
if(currentUser== 'admin')
$('').insertAfter('#ShopInfo_shop_area_id option:last');

");

?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477462.htmlTechArticleautoLoad The name cannot be repeated with other Scripts! Do not use comments, such as // Embed PHP variables: .$params[sdate]. option value=
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!