Maison > interface Web > tutoriel HTML > contenteditable 输入 网址 的问题。在线等。。_html/css_WEB-ITnose

contenteditable 输入 网址 的问题。在线等。。_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Libérer: 2016-06-24 12:25:56
original
1561 Les gens l'ont consulté

contenteditable 网址 contenteditable 网址 超链接

快来救命。
html 元素属性里面 加入contenteditable="true" 后 
怎么控制 输入  www.baidu.com 这样的内容后
不让自动变成超链接!!!

回复讨论(解决方案)

html 元素属性
re:
用的什么元素?

用的body ,如果可以用其他元素解决这个问题 也是可以的 ,不一定要 body

html 元素属性
re:
用的什么元素?

用的body ,如果可以用其他元素解决这个问题 也是可以的 ,不一定要 body 

改用designMode  方式来实现

改用designMode  方式来实现

我怎么没发现它变成连接呀


改用designMode  方式来实现

我怎么没发现它变成连接呀
在IE下会

改用designMode  方式来实现

editDocument.designMode = "on";
可以实现编辑,但是 输入  www.baidu.com 还是会变成超链接。



改用designMode  方式来实现

我怎么没发现它变成连接呀
在IE下会
怎么办呢。有什么办法拦截掉 不让他自动给我转换就好了,我看百度贴吧 的那个就可以输入网址什么的。

没在ie下测试

window.onload=function(){document.execCommand("AutoUrlDetect", false, false);}</script>
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

没在ie下测试

window.onload=function(){document.execCommand("AutoUrlDetect", false, false);}</script>
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

太感谢了。。 我之前有想过 应该有个这样的命令,但是我在文档里面又没有找到。
还希望你能给出 command identifiers 的文档路径,
我在 IE 和 chrome 火狐 都 测试通过 。
强烈 告诉我你在哪看到的 command identifiers

document.execCommand("AutoUrlDetect", false, false); 有效
execCommand 的命令里找过没看到


没在ie下测试

window.onload=function(){document.execCommand("AutoUrlDetect", false, false);}</script>
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

太感谢了。。 我之前有想过 应该有个这样的命令,但是我在文档里面又没有找到。
还希望你能给出 command identifiers 的文档路径,
我在 IE 和 chrome 火狐 都 测试通过 。
强烈 告诉我你在哪看到的 command identifiers

msdn: http://msdn.microsoft.com/en-us/library/aa769893%28v=vs.85%29.aspx

stackoverflow.com: http://stackoverflow.com/questions/7556007/avoid-transformation-text-to-link-ie-contenteditable-mode



没在ie下测试

window.onload=function(){document.execCommand("AutoUrlDetect", false, false);}</script>
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

太感谢了。。 我之前有想过 应该有个这样的命令,但是我在文档里面又没有找到。
还希望你能给出 command identifiers  的文档路径,
我在 IE  和 chrome 火狐 都 测试通过 。
强烈 告诉我你在哪看到的 command identifiers 

msdn: http://msdn.microsoft.com/en-us/library/aa769893%28v=vs.85%29.aspx

stackoverflow.com: http://stackoverflow.com/questions/7556007/avoid-transformation-text-to-link-ie-contenteditable-mode
为毛我这样用,提示参数无效呢?

参数无效,妹啊,神啊,问题单如何改?

Unfortunately, there is no cross-version solution. In IE9 there is opportunity, allowing to disable automatic hyperlinking

Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal