Reputation: 405
I want to open a url(ex. www.google.com) in jquery mobile android app. I want to open it with in the context of the app itself. i dont want to open a diffrent browser to launch it on the click of the link or button. i want to open it with in the app. is it possible. Thanks.
Upvotes: 1
Views: 2200
Reputation: 1294
Found the solution here:
function openInWebView(url)
{
var anchor = document.createElement('a');
anchor.setAttribute('href', url);
var dispatch = document.createEvent('HTMLEvents')
dispatch.initEvent('click', true, true);
anchor.dispatchEvent(dispatch);
}
Then call the function like this in your app:
openInWebView('http://google.com')
Upvotes: 1