【问题标题】:code change from php to coldfusion代码从php更改为coldfusion
【发布时间】:2014-10-07 15:49:24
【问题描述】:

在php中有如下代码

print $row['from_id'].';;;'.$row2['username'];

我改为coldfusion为;

<cfoutput>#res.from_id# ;;; #res2.username#</cfoutput>

但它给了我一个错误:

错误:

uncaught exception: Syntax error, unrecognized expression: [title="2 "]

因为文件是在jquery中调用的

$.ajax({
                type: "POST",
                url: 'load.cfm',                            
                data: 'own_id='+own_id,
                success: function(o){                                               
                    if(o != 0){
                        var substr = o.split(';;;');        
                        if($('div[title="'+substr[0]+'"]').length == 0){                    
                            iopen(substr[0],substr[1],1);
                        }                                               

                    }
                }
            });

【问题讨论】:

  • 它给你什么错误?

标签: php coldfusion


【解决方案1】:

这是因为:

<cfoutput>#res.from_id# ;;; #res2.username#</cfoutput>
                       ^---^

这使得substr[0] 中有一个空格。您需要修剪空白,或者直接删除它,因为 PHP 中没有空格。

 <cfoutput>#res.from_id#;;;#res2.username#</cfoutput>

【讨论】:

    猜你喜欢
    • 2011-08-14
    • 2011-02-18
    • 1970-01-01
    • 1970-01-01
    • 2019-06-24
    • 2017-01-19
    • 1970-01-01
    • 1970-01-01
    • 2018-01-31
    相关资源
    最近更新 更多