【问题标题】:TinyMCE TemplateTinyMCE 模板
【发布时间】:2012-05-25 20:44:54
【问题描述】:

是否可以在 tinyMCE template_templates 块中插入 jQuery 脚本?

这里是 template_templates 块

template_templates : [
    {
            title : "Editor Details",
            src : "editor_details.htm",
            description : "Adds Editors Name and Staff ID"
    }
]

我想把 jQuery 放在这里

template_templates : [
  //jQuery
]

在这里需要一些帮助!

【问题讨论】:

    标签: jquery tinymce cakephp-1.3


    【解决方案1】:

    是的,你可以。据我所知,它只能是一条语句([] 之间的分号会产生错误)。对于更复杂的代码,您可以将其包含在一个函数中:

    template_templates : [
        function() {
            //jQuery code here
        }
    ]
    

    或者,根据你想要达到的目标,你可以放一个变量,它的值可以在这个对象之外计算。

    【讨论】:

      猜你喜欢
      • 2011-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多