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

  • SEARCH
  • Home
  • 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 8449263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:39:10+00:00 2026-06-10T10:39:10+00:00

I’ve got an index.php with a listview containing links to profile.php which takes an

  • 0

I’ve got an index.php with a listview containing links to profile.php which takes an id paramter with a specific ID:

<div data-role="content">
    <div class="choice_list">
        <ul data-role="listview" data-inset="true" >
            <li><a href="profile.php?id=1" data-transition="slidedown"><img src="martin.jpg"/>Martin</a></li>
            <li><a href="profile.php?id=2" data-transition="slidedown"><img src="liisa.jpg"/>Liisa</a></li>
        </ul>
    </div>
</div>

In profile.php I include my profile.js file which must run a bunch of stuff within:

$(document).ready(function() {

    // Loads specific user data via API calls

});

PROBLEM: When I visit profile.php the first time it all works fine, but when visiting it again my Javascript (profile.js) won’t run. I know similar questions have been asked before and I’ve checked a bunch of them out, but I didn’t really understand the answers, and the couple of solutions I tried didn’t work out at all (trying to stop jqm from page caching and whatnot). Is there a somewhat simple solution to this problem that could be applied to my code?

Using jquery.mobile-1.0.1.js

Thanks in advance

/Andreas

  • 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-10T10:39:12+00:00Added an answer on June 10, 2026 at 10:39 am

    The jQuery mobile documentation for events states this:

    Important: Use $(document).bind(‘pageinit’), not $(document).ready()

    The first thing you learn in jQuery is to call code inside the
    $(document).ready() function so everything will execute as soon as the
    DOM is loaded. However, in jQuery Mobile, Ajax is used to load the
    contents of each page into the DOM as you navigate, and the DOM ready
    handler only executes for the first page. To execute code whenever a
    new page is loaded and created, you can bind to the pageinit event.

    I think pageinit is only fired the first time a page is loaded, so if you go to a page, then go to another page, then go back to the first page, the init event will not fire the second time. To overcome this, you can use the pageshow event maybe as well

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.