Programmatically trigger copy menu in iOS safari using javascript?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 02:56:59

It's not possible unfortunately. I'd include some informative text below the input, hopefully that will work out okay in terms of user-friendliness.

Another option would be to go native, e.g. by wrapping using PhoneGap, but I guess you are already well aware of that option. If so, something like this would work in native code:

[UIPasteboard generalPasteboard].string = @"your string";

From javascript it is possible with the help of iOS (objective C).

var getVal = $("#textid").val();
localStorage.setItem("getVal",getVal);

and then you can use your native code for getting this value from local storage.

I haven't knowledge of objective C but you can use that's method after js code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!