-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot call method 'copy' of undefined #1
Comments
From phonegap build 3.1.0 , you dont need to write- $.getScript("js/plugins/com.verso.cordova.clipboard/www/clipboard.js"); Use the code in the following way - var text="Sample Text"; |
when I just use |
Make sure the plugin has been properly configured in your project.You can confirm this by checking in the YourProject/res/xml/config.xml , the plugin should be registered in this way:
Or by running this command from CLI interface: $ phonegap local plugin list If properly configured, the plugin should be listed there. From Phonegap 3.1.0, you dont need to import any specific js files of plugins. Just register them by CLI Interface. |
As @gouravkakkar pointed out, it seems that the plugin hasn't been installed properly. You should try reinstalling it. |
OK |
I tried many many times,it still not work by "phonegap build" 3.1 in phonegap build just like that way is it real work by "phonegap build"? PS,I am very sure that the Clipboard plugin has been install |
Using Phonegap 3.1 in iOS 7, it works just fine for me. Example: cordova.plugins.clipboard.copy('some text'); |
thanks for jprichardson reply |
|
ok is it as same as yours? |
Are you building locally or remotely with PhoneGap Build, and for what platform? |
remotely Android,4.03,HTC Sensationa XL I will try in locally building |
I just test the Android 4.1.1 and iOS 7.0.4 this is my "local" index.html code,and I am very sure that my phonegap.js is loaded success
no mater I click the local1 or local2 or local3,the alert message never appear |
You have to change your commands to |
thanks to @ctrevisan by the way |
The sources for the plugin are missing from your project. You should have Clipboard.java under |
I don't know how to use the CLI |
well~ is to use...window,not cordova
|
Strange... Anyway, I'm glad it solved your problem :-) |
For cordova CLI use cordova.plugins.clipboard.copy and cordova.plugins.clipboard.paste |
@bau720123 : hi can you give me a link of your example? |
i am getting the same problem with ionic ngCordova i have opened a new issue here #14 |
I am using phonegap build 3.1,and very sure that my phonegap.js and clipboard.js are all loaded successfully
but when I use your code and run it...nothing happened
and I use Chrome to debug,it said "Cannot call method 'copy' of undefined"
here is my code
http://www.littlebau.com/copy.html
The text was updated successfully, but these errors were encountered: