Jquery mobile href link dont load new page

前端 未结 1 667
感情败类
感情败类 2021-02-11 10:38

i\'m a web devoper from Italy...I have a problem with loading with href example: i have one.html with this code




          


        
相关标签:
1条回答
  • 2021-02-11 11:23

    This is not an error. To understand this problem you must understand how jQuery Mobile works.

    Multi HTML template can't be mixed with multi page template. For example when working with several HTML pages, only first one can have more then one page. When jQuery Mobile loads other HTML files it will strip HEAD (we dont need it because first HTML HEAD content is already loaded into the DOM) and it will load ONLY first page it can find in a file, every other page will be discarded.

    data-prefetch will not help you here. Also you are initializing it incorrectly, data-prefetch attribute don't have a value, it is just data-prefetch, example:

    <a data-role="button" data-theme="a" data-transition="fade" href="two.html" data-prefetch>Login</a>
    

    If you want to find out more how jQuery Mobile handles multiple HTML and multiple page templates or what are they take a look at this ARTICLE or THIS one. To be transparent they are my personal blog articles. Everything you need to know can be found there.

    Basically solution to your problem would be to have all pages inside a single HTML file, or you should brake two.html into two separate HTML files. you decide what is a best solution for you.

    0 讨论(0)
提交回复
热议问题