最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

coldfusion - cfscript language="javascript" does not work - Stack Overflow

programmeradmin1浏览0评论

Here is my code:

<cfscript language="javascript">
      OpenText(document.getElementById(#url.id#));
</cfscript>

Here is the error:

Invalid token l found on line 731 at column 19.

The CFML piler was processing:

A cfscript tag beginning on line 731, column 10.

Why?

Here is my code:

<cfscript language="javascript">
      OpenText(document.getElementById(#url.id#));
</cfscript>

Here is the error:

Invalid token l found on line 731 at column 19.

The CFML piler was processing:

A cfscript tag beginning on line 731, column 10.

Why?

Share Improve this question edited Dec 4, 2012 at 16:18 Leigh 28.9k10 gold badges57 silver badges109 bronze badges asked Dec 4, 2012 at 9:43 Chani PozChani Poz 1,4632 gold badges21 silver badges47 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 11

<cfscript> doesn't take a language attribute. You are probably just wanting to do:

<script type="text/javascript">
<cfoutput>
OpenText(document.getElementById(#url.id#));
</cfoutput>
</script>

Incidentally, the language attribute is also deprecated on the <script> tag in HTML 4, and you should use type instead (as in my example). In HTML5 you can just do <script> without either language or type attributes.

OpenBD supports this apparently, but ColdFusion does not.

发布评论

评论列表(0)

  1. 暂无评论