Is there a way to get $ .mobile.pageCreate with jQuery 1.3.0 in Webkit browsers?

I tried posting this question before and did not realize at the time that the problem I was facing came from using jQuery 1.3.0 library.

I am trying to create a dialog without user interaction on the page using jQuery mobile. It works in FireFox, but does not work in all webkit browsers, including Safari, Mobile Safari, and Chrome.

Here is an example of a problem: http://jsfiddle.net/fskirschbaum/2YTwE/

$.mobile.changePage( '#dialog' , { transition:"pop", role:"dialog" }); 

I tried several different ways to make this thing work correctly, and I feel like I'm banging my head on a wall. It works if you change the database to 1.2.0, so it seems to be a problem with 1.3.0, but I do not see anyone else seem to be facing this problem.

EDIT: I tried to associate this with several events without any success, including: pagecreate, pageinit, pageload, etc. This does not seem to help. I will also point out that this is a problem because this library crashed into another library on the vanilla page with only jQuery and jQuery mobile. I can get this to work using library 1.3, but not on jsFiddle or in my environment (I call many other libraries, such as jQueryUI and others, and I tried to adjust the order they call.)

Does anyone have any suggestions?

+4
source share
2 answers

So it looks like this has something to do with webkit rendering and issues with some other libraries.

The wrapper of the function in pageshow did not work for my environment, but its completion in pagecreate , this is the event called after createPage. I did not determine why this happened, but it really works.

http://jsfiddle.net/fskirschbaum/pKw2A/

This solution, however, breaks down in the rendering of Firefox / Gecko, so the function must be completed in a browser check to make it work. Obviously, this is not the most elegant solution, but this solution is all the same.

Hope this helps someone else to have the same issues.

+1
source

Call $.mobile.changePage as shown below.

 $(document).on('pageshow', '#home', function(){ $.mobile.changePage('#dialog'); }); 
0
source

All Articles