Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

I have the following javascript on the device ready event (I have also tested it with the "load" event) on the start page.
var URL = encodeURI(url);
var ref = window.open('http://www.google.com', '_blank');
alert('ref='+ref);
The web page does not appear on my ApperyIo App on my iphone (I know it is not supposed to work on the chrome web browser). The alert window does not appear either. Can you tell me what is wrong?
If I comment out the 'encod..' line and the 'window..' line the alert will show on my iPhone.
suggestions?

Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

I found the issue, forgot to load url. Duh!

Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

Well, still doesn't work on iPhone.
The app starts but the webpage does not show.
Testing with Chrome browser, it shows the webpage in a separate browser window.
Suggestions????

Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

I have changed the code to :
var URL = encodeURI('http://www.google.com');
var ref = window.open(URL, '_blank');
alert('ref='+ref);

On my iPhone the alert shows that 'ref' is undefined.
Can you tell me what is wrong?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Problem Showing website page on start page using InAppBrowser

Hello,

Your code looks correctly to me. Could you please try to execute this code:
pre
var ref = window.open('http://apache.org', '_blank', 'location=yes');
/pre
on button click event.
This links should be helpful:
http://docs.appery.io/tutorials/using...
http://docs.phonegap.com/en/3.3.0/cor...

Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

Thanks for the links, but I already discovered those links while researching this problem.
I placed a button on my start page with the 'window.open...' above, executing as a button click event. This code works on my iPhone when I click the button.
I also replaced my 'window.open...' with your 'window.open...' above on my start page executing javascript on the 'Load' event. It still does not work on my iPhone. The alert window says that 'ref is undefined'.
Why doesn't it work on the 'Load' event? I also tried the 'Device Ready' event with same effect.

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Problem Showing website page on start page using InAppBrowser

Hello,

The matter is that the function windows.open returns nothing, so alert shows "undefined".

Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

The problem is not the alert. I just use that for debugging.
The problem is that the web page does not display in the InAppBrowser when called from the start page in the 'load' or 'device ready' event.
If I take the alert out, it still does not show the webpage when the app starts.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Problem Showing website page on start page using InAppBrowser

Hi - can you share your app with us, so we can try it? (what device you're testing and what OS version is used).

Tro Murphey
Posts: 0
Joined: Wed Mar 26, 2014 2:38 pm

Problem Showing website page on start page using InAppBrowser

How do I share the app with you?
I use the iPhone with version iOS 7.1

Return to “Issues”