Javascript 文本扩展器

发布于 2024-12-29 04:37:25 字数 214 浏览 5 评论 0原文

我正在尝试构建一个非常简单的表单来帮助我输入评论(与客户聊天后留在我们的系统中),并将“cci”之类的内容替换为“客户打电话”。

这可以用 JavaScript 实现吗? 我问这个问题是因为我们不允许安装任何软件,例如 Texter,但是我们可以在工作中携带 html/js 文件。

希望我的问题得到完整的描述,我提前感谢您!

PS:任何片段或教程链接都非常感谢!

I'm trying to build a really simple form to help me out typing comments (left in our systems after chatting with customers) and get something like "cci" get replaced by "customer called in".

Is this possible with javascript?
I'm asking this because we're not allowed to install any software such as Texter however we are allowed to bring html/js files at work.

Hoping that my problem has been described in full I would like to thank you in advance!

PS: any snippets or links to tutorials are really appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的奇迹 2025-01-05 04:37:25

制作一个定期运行并替换文本区域中的快捷方式的函数:

update = function() {
    textarea.value = replace-shortcuts-in(textarea.value);
}

textarea.onkeydown = function() {
    clearTimeout(timer);
    timer = setTimeout(update, 200);

}

完整的工作示例: http://jsfiddle.net/ucsED /

Make a function which runs at regular intervals and replaces shortcuts in a textarea:

update = function() {
    textarea.value = replace-shortcuts-in(textarea.value);
}

textarea.onkeydown = function() {
    clearTimeout(timer);
    timer = setTimeout(update, 200);

}

Complete working example: http://jsfiddle.net/ucsED/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文