jquery代码段中的变量不能被解析

浏览:548 发布日期:2011/05/18
- 普通 - 未处理
html:
$(function() {    
    var pg = App.editInfo.ui;
    pg.params = pg.params || {};
    var editors = "{$editor}";
......
action:public function add() {
        $mId = $_REQUEST['model_id'];
        $model = D('ModelField');
        $map['status'] = array('eq',1);
        $map['post'] = array('eq',1);
        $list = $model->where($map)->select();
        $formhtml = '';
        $editor = '';
        foreach ($list as $key => $field) {
            $formhtml .= '
        '.$field['title'].':
        '.$field['formhtml'].'
    ';
            if($field['htmltype'] == 5){
                $editor .= ','.$field['name'];
            }
        }
        $this->assign('modelField',$formhtml);
        $this->assign('editor',$editor);
        $this->display();
    }
解析后:
$(function() {    
    var pg = App.editInfo.ui;
    pg.params = pg.params || {};
    var abc = "{$editor}";
    var editors;
    $.post('__URL__/getEditorFields',{model_id: pg.params.model_id},function(data){
那个变量没有解析
评论(
后面还有条评论,点击查看>>