Ninjadoodle Posted February 3, 2015 Share Posted February 3, 2015 Hi guys Has anyone been able to successfully open an external link using CocoonJS and Panda? I've included the file (tried both the manual way and using the Panda plugin) and used ... Cocoon.App.openURL('http://www.ludei.com'); All I get is errors, as if Cocoon JS was trying to load the websites graphics into the wrapper, instead of opening a window. The Cocoon JS staff tell me it's working fine in their demos, so I'm lost. Any advice would be appreciated! Thank you! Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 10, 2015 Author Share Posted February 10, 2015 Hi guys! I still can't get this to work Just wondering whether anyone has managed to get outgoing links working with CocoonJS? Thank you for any info! Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted February 10, 2015 Share Posted February 10, 2015 Hello, You can use window.open ^^window.open('http://google.com'); Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 10, 2015 Author Share Posted February 10, 2015 Hi @ThanosS Thanks for replying I've tried the above as well as the CocoonJS specific line Cocoon.App.openURL('http://www.ludei.com'); Neither works and throws errors. No idea what to do about this or what might be causing it. Quote Link to comment Share on other sites More sharing options...
agamemnus Posted February 10, 2015 Share Posted February 10, 2015 I noticed you are using a http://www.ludei.com');" and not "Cocoon.App.openURL('http://www.ludei.com;')"? You should start debugging your code by deactivating parts of it until the problem no longer presents itself. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 10, 2015 Author Share Posted February 10, 2015 Hi @agamemnus Yup I definitely have ... Cocoon.App.openURL('http://www.ludei.com'); When I click the link while running the game in the CocoonJS player, I get errors and what looks like the CocoonJS wrapper trying to load the website's elements into the wrapper. Quote Link to comment Share on other sites More sharing options...
Wraithi Posted February 10, 2015 Share Posted February 10, 2015 Hi, i had same issue like you. Make sure, you using latest cocoonjs plugin: https://github.com/ludei/cocoonjs-plugins/tree/master/build I use this code in my game:this.btnFacebook.click = this.btnFacebook.tap = function () { if (navigator.isCocoonJS) { Cocoon.App.openURL("https://www.facebook.com/pexesomemorygame"); } else { window.open("https://www.facebook.com/pexesomemorygame"); } };Good luck. goide 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 10, 2015 Author Share Posted February 10, 2015 Hi @Wraithi Thank you for your help! I still can't get it to work tho It works perfectly on desktop but not in CocoonJS. I use the same code as you and include this file in my index.html ... <script type="text/javascript" src="src/plugins/cocoon.js"></script> Quote Link to comment Share on other sites More sharing options...
Wraithi Posted February 11, 2015 Share Posted February 11, 2015 Hi Ninjadoodle. I made a simple demo for you. Try this demo with latest CocoonJS: https://www.wetransfer.com/downloads/f12b791b74005603b0c391bab9ba623d20150211095102/0254688451a3e0ef1c59c6499e48b4cf20150211095102/527e16 (In demo, click on panda logo) Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 11, 2015 Author Share Posted February 11, 2015 Hi @Wraithi Thank you VERY much, for making the sample! I really appreciate your help Your example works perfectly, but for some reason mine still doesn't. There are no differences as far as I can tell. I've even tried copying your engine and cocoon files just to be sure. I'm going to have to make a new folder and start pasting in things from scratch until I hit an error. Thank you heaps again!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.