deviceready not firing in PGB

  • 1
  • Problem
  • Updated 6 years ago
  • Solved
Hello,

My app has multiple pages. In one of my pages, deviceready doesn't fire so I cant use some phonegap plugins etc.

My app ID is 1057505 and the page that has the problem is sat.html and sat.js
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of Eddy Verbruggen

Eddy Verbruggen, Champion

  • 375 Posts
  • 86 Reply Likes
Did you correctly add a reference to the injected cordova.js (in the root folder) to sat.html?
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
I added the reference like this:

script type="text/javascript" src="phonegap.js"></script

Is it wrong?
Photo of Eddy Verbruggen

Eddy Verbruggen, Champion

  • 375 Posts
  • 86 Reply Likes
Depends. If sat.html is in the root folder it is. If it's in a sub folder you need to change it to ../phonegap.js
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
It is in the root folder so I assume I am doing it right.
Photo of Eddy Verbruggen

Eddy Verbruggen, Champion

  • 375 Posts
  • 86 Reply Likes
Maybe there's a js error somewhere. You'll need to wait for pgb folks to step in or post a link to your code uf you want others to help.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
any staff member here?
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Hi,

Will look at this in a bit.

Sorry for the late reply and thanks Eddy for the help so far.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
Still no solution?
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
App has been deleted.

Provide us with latest app id.

Thanks.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
1063153
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Also can I know what page I need to navigate to and this breaks?

Thanks.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
go to sat.html and sat.js

other pages are working just fine.
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Tested this just now.

Worked when I set the source directly to the page(since I don't have a login credential to access the page as normal).

Would send you the corrected code used.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
What do you mean by setting the source directly to the page?
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Hi, there is a parameter in config.xml that allows you to access any page as the launch page on iOS and Android:

<code><content src="somepage.html"/></code>

So I accessed your Sat page directly using that.

Have a look at the file I sent you.

Thanks.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
Your code works fine.
I guess I figured out what is wrong. In my app, I navigate to sat.html from a different page using href="sat.html"..
So the problem is when I click that link, sat.html loads but the .js file doesn't load.

I think I should navigate to the sat.html via the javascript not the html href
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
You can try that Emre.

Let us know if that doesn't work though.
Photo of Emre

Emre

  • 28 Posts
  • 0 Reply Likes
I changed the click events. I assigned the events to the buttons on the javascript side. It works great now. You can close this topic.
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Noted.

Thanks for the update.

Glad you got this working.

This conversation is no longer open for comments or replies.