jquery粘贴按钮,按钮单击时在jquery / java脚本中粘贴功能

I have a textbox for write website url.And I place a button beside that.

I want if a user copy a url from any place and click on that button then the copied url paste in that textbox.

Now I can use ctrl+v to paste the url in the text box.But then mobile user not able to use that.

So I need on click on that button the copied url paste in textbox.

Any help highly appreciable and thanks in advance.

解决方案

Based upon many SO questions from the past...

... the answer is probably "No, it's impossible."

I would suggest, though, that you've skipped an important step in your development process. The problem you face is that you want to allow mobile users to painlessly enter text (in particular, URLs, which are a pain to type) from other sources into a textbox on your site. Take a step back and look at other possible solutions to that problem that don't involve Javascript access to the user's clipboard.

In fact, the 'solution' you're currently trying to implement doesn't even help the user, because the 'click to paste' button is only helpful to a mobile user if they've already succeeded in copying something to their clipboard, and if they've managed that, then presumably they already know how the native Copy/Paste functionality of their phone browser works, so they don't need your button. There are two necessary steps in the user flow you've described: copying a URL from some other source, and pasting it on your site. Even if what you're currently asking for were possible, it could only possibly help you make the second step easier for the user.

Instead, I figure you should check how copy and paste work on different available brands of smart phones and their browsers. If any of them use obscure or opaque interfaces that you worry your users may be unfamiliar with, have a button near your text box that is shown only to users of those platforms that gives them platform-targeted instructions on how to use their native copy and paste functionality.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值