Question: Consider this HTML source code:

```
<form id="foo1" name="x"> Form 1 </form>
<form id="foo2"> Form 2 </form>

```

As you can see, we define two FORM elements.

In Chrome, Safari and Firefox, both `document.foo1` and `document.foo2` return `undefined`. 

However, in IE and Opera, `document.foo1` returns a reference to the corresponding FORM element, whereas `document.foo2` returns `undefined`.

**Live demo:** <http://jsfiddle.net/zrmEm/2/>

So, the first form does have its ID-named property in the document object, and the second form doesn't. And this difference is the result of adding the `name` attribute to the first form.

Now, where's the logic in that? Is this a known behavior?

Answer: 
What looks to be happening is you're navigating outside the scope of jQM, but 1.html is in location.hash. 

> 
> Hash changes that occur independently of a click, such as when a user
>  clicks the back button, are handled through the hashchange event,
>  which is bound to the window object using Ben Alman's hashchange
>  special event plugin (included in jQuery Mobile). When a hash change
>  occurs (and also when the first page loads), the hashchange event
>  handler will send the location.hash to the $.mobile.changePage()
>  function, which in turn either loads or reveals the referenced page.
> 
> 
> 

I assume location.hash has the initial 1.html when it loads but doesn't track the new page while using window.location to navigate to a new page. Since you are using the browser back button jQM uses the last tracked location which in your case is 1.html.

I would suggest using jQM's `$.mobile.changePage()` if you need to track the location.
More on jQM Navigation can be found in the docs:

* <http://jquerymobile.com/demos/1.0rc1/docs/pages/page-navmodel.html>
* <http://jquerymobile.com/demos/1.0rc1/docs/api/events.html>
* <http://jquerymobile.com/demos/1.0rc1/docs/api/methods.html>
If you want jQuery mobile to handle the history and back button you need to use $.mobile.changePage to change the page (as opposed to window.location=..).

More info here: <http://jquerymobile.com/demos/1.0rc1/docs/api/methods.html>