强制CKEDITOR刷新配置 [英] Force CKEDITOR to refresh config

查看:879
本文介绍了强制CKEDITOR刷新配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用CKEDITOR的cms应用程序,当我添加一些功能到CKEDITOR我需要刷新一些CKEDITOR .js /.css文件。



但CKEDITOR force



我看到它对所有.js / .css文件使用了查询字符串>此查询字符串反映CKEDITOR版本我认为:

  /Js/ckeditor/config.js?t=CAPD 
/Js/ckeditor/lang/it.js?t=CAPD
/Js/ckeditor/plugins/onchange/plugin.js?t=CAPD

在CKEDITOR中有一个嵌入的方法吗?



我在文档中找不到任何东西。
我使用CKEDITOR 4



主要的问题是,当我上传一些更改时,他们不会被客户端更新,新功能不可用或最差

解决方案

我发现了一种非常优雅的方式:



这足以设置:

  CKEDITOR.timestamp ='ABCD';只要链接ckeditor.js 之后,或者无论如何,ckeditor加载它的所有内容之前,



<文件



这是CKEDITOR用来向所有.js .css文件添加动态加载时间戳的变量。



所以每次我更改这些文件,我更新该变量和浏览器将重新加载它们。


I created a cms application that use CKEDITOR and when I add some functionality to CKEDITOR I need to refresh some CKEDITOR .js /.css file.

But CKEDITOR force the browser to cache them.

I see that it uses a querystring to all .js/.css files

This querystring reflect the CKEDITOR version I suppose:

/Js/ckeditor/config.js?t=CAPD
/Js/ckeditor/lang/it.js?t=CAPD
/Js/ckeditor/plugins/onchange/plugin.js?t=CAPD

Is there an embedded method to do that in CKEDITOR?

I could not find anything in the documentation. I'm using CKEDITOR 4

The main problem is that when I upload some changes they are not updated by the clients and new functionality are not available or worst case CKEDITOR does not work.

解决方案

I have found a quite elegant way:

It is enough to set:

CKEDITOR.timestamp='ABCD';

just after you link ckeditor.js or anyhow before ckeditor loads all its files

this is the variable CKEDITOR uses to add timestamp to all .js .css files it loads dynamically.

So every time I change those files I update that variable and browsers will reload them.

这篇关于强制CKEDITOR刷新配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆