下一页的jQuery移动不工作。

时间:2022-07-05 21:13:03

I am making a website with jQuery mobile but I have a problem.

我正在用jQuery mobile做一个网站,但我有一个问题。

My first page look like this:

我的第一页是这样的:

<div id="page">
<div data-role="header" data-position="fixed">
    <a href="registreren.html">Registreren</a>
    <h1>Name</h1>
</div>

<div id="container">
    <form id="loginform" method="post">
        <input type="text" name="gebruikersnaam" placeholder="Gebruikersnaam">
        <input type="password" name="wachtwoord" placeholder="Wachtwoord">
        <input type="submit" data-theme="b" value="Inloggen">
    </form>
</div>

When I click in the header on the link I go to the page, no problem so far. But when I am on that page he doesn't do anything for example I have an alert on that page but he doesn't show it. When I go to registreren.html without the first page he shows the alert, what do I do wrong?

当我点击链接上的标题时,到目前为止没有问题。但是当我在那个页面上的时候他什么都不做比如我在那个页面上有一个警告但是他没有显示出来。当我去登记的时候。html没有第一页他显示了警告,我做错了什么?

I hope someone can help me.

我希望有人能帮助我。

1 个解决方案

#1


3  

To understand this situation you need to understand how jQuery Mobile works. It uses ajax to load other pages.

要了解这种情况,您需要了解jQuery Mobile是如何工作的。它使用ajax加载其他页面。

First page is loaded normally. Its HEAD and BODY is loaded into the DOM, and they are there to await other content. When second page is loaded, only its BODY content is loaded into the DOM.

第一页正常加载。它的头和身体被加载到DOM中,它们在那里等待其他内容。当加载第二页时,只有它的主体内容被加载到DOM中。

To find out more and how to solve this problem (with solutions and examples) take a look at my other answer: Why I have to put all the script to index.html in jquery mobile

为了找到更多的答案,以及如何解决这个问题(有了解决方案和例子),看看我的另一个答案:为什么我必须把所有的脚本都放在索引中。html在jquery移动

#1


3  

To understand this situation you need to understand how jQuery Mobile works. It uses ajax to load other pages.

要了解这种情况,您需要了解jQuery Mobile是如何工作的。它使用ajax加载其他页面。

First page is loaded normally. Its HEAD and BODY is loaded into the DOM, and they are there to await other content. When second page is loaded, only its BODY content is loaded into the DOM.

第一页正常加载。它的头和身体被加载到DOM中,它们在那里等待其他内容。当加载第二页时,只有它的主体内容被加载到DOM中。

To find out more and how to solve this problem (with solutions and examples) take a look at my other answer: Why I have to put all the script to index.html in jquery mobile

为了找到更多的答案,以及如何解决这个问题(有了解决方案和例子),看看我的另一个答案:为什么我必须把所有的脚本都放在索引中。html在jquery移动