Open link in external browser phonegap - javascript

I am trying to open a link into an external browser with phone gap 3.3.0 but i am having no luck. I added the plugin to the config file and phone gap is in the index.html file as well so i know those have loaded. I have an anchor that calls
openURL(url) which then calls the following function.
function openURL(urlString){
var myUrl = encodeURI(urlString);
window.open(myUrl,'_system');
}
as far as i can tell i have done everything right that is said in the documentation but it still will not load in safari on the iOS. I am testing on a iPad mini running IOS 7 but i have also tested it on android and i get the same issue.
Thanks in advance for any help you can provide.
Update
So I ended up bootstrapping angular which seems to have done something but when i open a link it appears without a toolbar

Have you seen this question? http://community.phonegap.com/nitobi/topics/pgb_3_3_open_link_in_external_system_browser_not_working_in_ios?rfm=1
need to add:
<gap:plugin name="org.apache.cordova.inappbrowser" /> in config.xml
<script src="phonegap.js<>/script> in your index.html (in head)
open link via:
Test 6 manipulate html or:
window.open("http://www.google.de","_system");

Related

My site doesnt open from iPhone (iOS 11)?

I have some problems with my website. My site is coded in HTML,CSS and JS.
Everywhere works perfect, Desktop (all browsers), Android (All browsers), in iPhone(iOS.11) doesn't work!!!
I think there may be two problems:
1. When i open the site, i have Loading Page script, and in iPhone it stops there and doesnt open the site.
2. The problem may also be with the new iOS 11, because with earlier iOS(10) was working very well.
Any suggestion, or any site which i can check my errors (debugg) or..?
google didn't solve my problem so i decided to ask, but still can't find the problem!!!
Thanks.
If you have an OSX available you can enable remote debug and see what's happening, most likely something is breaking based on something not being available.

JQuery Mobile app, make a mobile call with HTML 5

I am using JQuery Mobile with Phonegap and I am trying to create a button and when I click it a phone call should be made. I have mad a lot of research for this problem and I have found the following solution
Call
or
Call
This solution is working on browsers (is asking me to open Skype) but when I run it on Android with a Samsung Galaxy S2 is not working. It is not doing anything.
I have tried to add to the config.xml file the following permission:
<access launch-external="yes" origin="tel:*" />
but is not working either.
If you have any solution to suggest please do so. Thank you!
if you are using inappBrowser plugin, you can launch an inappbrowser window with the tel: address :
var refcall = window.open('tel:'+phoneno, '_blank', 'location=no,closebuttoncaption=Home,disallowoverscroll=yes');
you might then notice that when the call ends, you are taken back to a white screen with the tel number written on top. to avoid this, append the below code too :
refcall.addEventListener('loadstop', function(event) {
console.log('done initiating call... closing inappbrowser module');
refcall.close();
});
Try and let us know. It worked fine for me.
have you tried ?
<a rel="external" href="tel:+123456789">Call</a>
CordovaCallNumberPlugin should help you
https://github.com/rohfosho/CordovaCallNumberPlugin
add the following line to config.xml
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.5.2" />
and use this command to dail the number:
window.open('tel:+123456789', '_system');
First of all, all the above answers you posted are correct and working fine. The problem I had, was that I was not including the cordova library in my app.
<script type="text/javascript" src="cordova.js"></script>
So when I have included the above line in the header of the page the phonenumber appeared on the Dial Screen! I am using the following code to create the call button:
<a rel="external" href="#" onclick="window.open('tel:+123456789', '_system');" data-role="button">Call</a>
I have tracked down the solution by creating a new phonegap app and use only the anchor tag given above. The cordova library was in the script by default.
Thank you for your answers

Opening safari webpage from Cordova app

I'm working on an APP that consist of HTML and CSS using the Cordova framework.
There is a button that should open a webpage. The problem is that it opens the webpage inside of the app instead of safari.
My knowledge of Objective C is extremely limited (none) so I was hoping there would be a solution using maybe Javascript.
I've looked all over the internet but couldn't find a non-Objective C solution.
The button is pretty straightforward: <img src="img/button.jpg" alt="website">
I thought target="_blank" might do something for me but that (unsurprisingly) didn't work.
You can use inappbrowser plugin
http://cordova.apache.org/docs/en/3.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser
Detect click on link using javascript or jquery and use this following code
window.open('http://www.google.com', '_system', 'location=yes');
I found the answer to my problem:
Opening all URL's with Cordova childbrowser
Only problem is that it automatically opens twitter.com because of the share button for some unknown reason. I'm guessing this is because of an api call it's performing upon being loaded.

Fancybox does not work on live site but works locally

I'm using a fancybox demo (http://fancyapps.com/fancybox/) on my personal site. Everything works perfectly when I'm testing locally, but once I uploaded the site to be live, the fancybox feature is not working and instead brings you to a new page view the image.
This is the site I am referring to: http://colettemolleur.com/. Click on the image to see the issue I'm having. Also, I'm not forgetting to upload any of the js files, so I don't know why this is happening.
Any thoughts?
Thanks!
Colette
Check your path for Bootstrap, main.js and query.mousewheel-3.0.6.pack.js which return 404 not found on your page. I suspect the path are incorrectly setted.
In chrome, use the developer tools (using F12 or right click+ inspect element) to check for error on the page. I get 4 when opening your page.

Mobile collapse bootstrap not working in Chrome

I'm fairly competent with HTML and am working with Bootstrap for the first time, but I can't seem to get the mobile collapsible menu working on Chrome on the desktop (and presumably some other browsers).
Safari on iOS 7 with default mobile responsiveness shows the menu fine when clicked, but nothing happens when you click it in Chrome on the PC when the browser is resized to a mobile-like width.
Sorry if it has been said before - just went through the code and couldn't really understand why it wasn't working! :(
First time on SO and can't figure out how to put my HTML in here, so here it is.
Thanks peeps :)
You have linked jQuery from Google CDN and hosting your website from Dropbox. Dropbox does not allow external linking of script and font files.
So you are getting an error on your page:
Host the jQuery file on your website and link (internal linking). Like for example put jQuery in JS folder and link:
<script src="js/jquery.min.js"></script>
Problem will be gone. Hope this helps!

Categories

Resources