开发者

Phonegap + JQuery Mobile paths

UPDATE:

I think my issue is related to this: https://github.com/jquery/jquery-mobile/issues/991

I haven't had time to try the patch yet. Anyone else know anything about this?

COMMENT:

It has something to do (I think) with the way ajax calls are made between phonegap and jquery mobile and jquery.

I know the code works because putting the EXACT same code in the index.html page vs putting it in the external page works.

The files are in the www folder, and are visible in xcode.

If I take the jquery mobile include out, the link to the page works fine, and the page loads, so I know it is related to the ajax file:// stuff

============================================

Using phonegap 0.9.5 and jquery 1.5.2 with jquery mobile 1.0a4.1

Platform OSX xCode 3

If I use jquery mobile pages all inside one index.html file, everything works fine.

But when I try to move a secondary page like this:

index.html search.html

<div data-role="page" data-theme="b" id="jqm-home"> 
    <div  data-role="header"  data-theme="a"> 
        <h1>Page Title</h1> 
    </div> 

    <div data-role="content"> 
        <ul data-role="listview" data-inset="true" data-theme开发者_JAVA技巧="c" data-dividertheme="b"> 
            <li data-role="list-divider">Search By</li> 
            <li><a href="search.html">Username</a></li> 
        </ul>    
    </div> 
</div>

I end up just getting the spinner forever.

I have tried:

/www/search.html

/search.html

file://www/search.html

All of those cause an instant page load failure.

if I just use the relative path in the code, I get the infinite spinner.

I also tried moving to jquery 1.6, and it didn't make any difference.

What am I missing here?


This required two updates to JQM, but we got it resolved. If anyone is interested you can find the fix info here.

https://github.com/jquery/jquery-mobile/issues/1580


I haven't worked with jQuery Mobile, but in terms of file locations for PhoneGap... all your files should reside inside the www folder. So like Marcy says, your link should be relative.

A few things to try:

1) Sometimes, if you have Xcode running and manually add a file to the directory... Xcode doesn't see it immediately. Make sure you can see the search.html file within Xcode. Maybe try quitting and restarting.

2) What happens if you relocate the link? Again, not being familiar with jQuery Mobile... I'd be curious to see if you could just get a basic link to work, outside of the UL. This might determine if it's a file location/path issue, or something related to styles/classes.

3) Out of curiosity, does the search.html page load up on its own? It's possible that the search.html is loading successfully, but something on that page is causing the hang. Maybe try replacing any content on your search page with a generic "Hello World" and see if you can get that to load up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜