Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9148519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:17:52+00:00 2026-06-17T11:17:52+00:00

This is the first page where I try to open the detail.html; <a href=detail.html

  • 0

This is the first page where I try to open the detail.html;

<a href="detail.html" data-role="none" role="link">
    <div class="place">name</div>
    <div class="arrow"></div>
    <div class="ammount">-&euro;4,<span class="fontsize14">25</span></div>
</a>

I have problems to load the scripts on detail.html (after href link is clicked on first page)

Here is my script in header of details.html(the page I go after href is clicked on first page), Problem is I can NOT get the console test print, that function is NOT called when details.html page is loaded. It only hits after I manually refresh the page

<script>
    $(document).bind("pageinit", function(){//or $(document).ready(function ()   
          console.log('test');
    });
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:17:53+00:00Added an answer on June 17, 2026 at 11:17 am

    To understand your problem I think you need to first understand how jQuery Mobile “loads” external pages. By default when you click a link to a separate HTML page JQM loads the first data-role=”page” on that page and attaches it to the DOM of the first page, the thing is JQM only loads that page div and not any scripts etc. that are outside that container.

    If you want to run code for a second page, you either need to include that script on your first page and use event delegation (since the second page is not part of the DOM yet) or include the script withing the second page’s date-role=”page” wrapper.

    Case in point in your case if you want to run code for your details page you either need to include the script on your first page for example assuming you have a div on your detail.html page like the following

    <div id="details" data-role="page"> ..rest of your content 
    </div>
    

    Then on your first page you could do the following

    $(document).on('pageinit', '#details', function() {
      console.log('test');
    });
    

    Or alternatively you can include a script tag withing your “details” page wrapper.

    EDIT:
    As I mentioned this is the default behavior, however if you wish you can tell jQuery Mobile to do a full post when loading a second page by adding in data-ajax="false" or rel="external" to your link for example

    <a href="detail.html" data-ajax="false" data-role="none" role="link">
        <div class="place">name</div>
        <div class="arrow"></div>
        <div class="ammount">-&euro;4,<span class="fontsize14">25</span></div>
    </a>
    

    The difference between data-rel="external" and data-ajax="false" is if the second page is basically semantic in that data-rel="external" should be used if the second page is on a different domain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

it s the first time i try this page. I ve just installed imagemagick
Please visit this link Click on first Image. Now is showing the Modal page
OK this is an odd error, as it's the first ajax page without any
I'm trying to do something like this http://myweb.com//page If first parameter is not present
The first two paragraphs of this page explain that generic views are supposed to
Ok, first off, I didn't program this page with frames! I'll be getting rid
Using Dozer to map two objects, I have: /** /* This first class uses
Try open the following page in two different tabs in your browser. hit the
This can be easily repeated on the official examples here: http://www.jacklmoore.com/colorbox/example1/ Open the first
I have some HTML code with a dialog inside, like this: <center> <a href=#add_auto

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.