作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
如果在 TinyMCE 中添加带插入链接的 URL 时不存在,是否可以在 URL 前添加“http://”?
最佳答案
为此,您需要复制 tinymce Insert Link 插件,重命名它,向其添加必要的代码(“http”-Adding)并将其用作您自己的插件。
编辑:好的,这是一个示例(使用 jQuery):
// You might need to change the event and/or tha handling
// but this should give you a guess at what needs to be done
setup : function(ed)
{
ed.onClick.add(function(ed, evt)
{
$(ed.getBody()).find('a').each(function(index, element){
if (!$(this).attr('href').search('http')){
$(this).attr('href', 'http://' + $(this).attr('href'));
}
});
});
},
关于http - TinyMCE:如果不存在,如何将 'http://' 添加到 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6061409/
我是一名优秀的程序员,十分优秀!