Skip to content
This repository

Can't load file:// pages #1578

Closed
jblas opened this Issue May 06, 2011 · 12 comments

2 participants

Kin Blas Stephen Smart
Kin Blas
jblas commented May 06, 2011

When a JQM document is loaded via file:// protocol, links to local files fail to load.

This issue was reported initially as a PhoneGap problem by @plethllc in Issue 991, but it seems that *ANY * non-Mozilla browser also exhibits the problem even on the desktop.

Something changed recently because this used to work.

Kin Blas
jblas commented May 06, 2011

I just checked in a fix for the file:// problem:

e775f5e

Kin Blas
jblas commented May 06, 2011

I just verified that this fixes things on desktop and in phonegap.

Kin Blas jblas closed this May 06, 2011
Stephen Smart

I just pulled the update down, did a new make, and i'm still seeing the same infinite spinner. This thing is killing me.

Kin Blas
jblas commented May 06, 2011

What do you mean "pulled the update"?

Stephen Smart

I did a pull from github on my checkout of jqm, got the commit you made, and did a make to rebuild the jqm js file.

Am I using a term incorrectly? (I'm not all that experienced with git lingo)

Stephen Smart

The JQM js file in xcode now shows this section of code, which is your change right?

//set the generated BASE element's href attribute to a new page's base path
reset: function() {
base.element.attr( "href", initialPath );
}

Stephen Smart

I stuck my example in a public repo if it would help to see any of it.

git@github.com:plethllc/jqm_bug.git

Kin Blas
jblas commented May 06, 2011

@plethllc

I just tested phonegap in the Mac iPhone emulator and it works just fine.

Can you test by using remote URLs? I'm using the following in my packaged app:

<link rel="stylesheet"  href="http://jquerymobile.com/test/themes/default/" />
<script type="text/javascript" src="http://jquerymobile.com/test/js/jquery.js"></script>
<script type="text/javascript" src="http://jquerymobile.com/test/js/"></script>
  • Kin
Stephen Smart

@jblas

Just tested, still getting the spinner.

See the repo I made above, but basically, two pages. (the comment thing with github seems to be eating part of the div on the second page example, but you can look at the repo if it isn't clear)

index.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"> 
        <img src="tux.png" />
        <ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b"> 
            <li data-role="list-divider">Search By</li> 
            <li><a href="#jqm-search">Username</a></li> 
            <li><a href="user.html">Email Address</a></li> 
        </ul>    
    </div> 
</div>

and user.html

Search By User

Search By Username
Submit
Kin Blas
jblas commented May 06, 2011

So the problem seems to be the data-ajax="false" on your form in the page you are trying to load. I'm not exactly sure why that would affect the page currently loading, but I'm looking into it.

If you remove that attribute temporarily, you will see that the page switches just fine.

Stephen Smart

I can confirm this, although I don't understand it.

Kin Blas
jblas commented May 06, 2011

@plethllc

I just filed issue 1580:

#1580

Please move any follow up discussions there. The original issue reported in 1578 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.