jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.7k stars 2.41k forks source link

Can't load file:// pages #1578

Closed jblas closed 13 years ago

jblas commented 13 years ago

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.

jblas commented 13 years ago

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

https://github.com/jquery/jquery-mobile/commit/e775f5e83a2b769479baeacc79c6912b381f5950

jblas commented 13 years ago

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

ghost commented 13 years ago

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

jblas commented 13 years ago

What do you mean "pulled the update"?

ghost commented 13 years ago

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)

ghost commented 13 years ago

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 ); }

ghost commented 13 years ago

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

git@github.com:plethllc/jqm_bug.git

jblas commented 13 years ago

@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>
ghost commented 13 years ago

@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

```

Page Title

```

and user.html

jblas commented 13 years ago

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.

ghost commented 13 years ago

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

jblas commented 13 years ago

@plethllc

I just filed issue 1580:

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

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