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 6360947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:42:49+00:00 2026-05-24T23:42:49+00:00

I’m really struggling to get my head round jQuery Mobile. I understand the DOM

  • 0

I’m really struggling to get my head round jQuery Mobile. I understand the DOM is inserted with the contents of each new page using AJAX for caching purposes. However, normally my development consists of using JavaScript in the jQuery ready event.

As a simple example, I have a page which shows an address, and a google map of the location. The pointer on the map is set via JavaScript.

When the map is shown, the address shows correctly (pulled in from MVC controller), but then I want the snippet of JavaScript to run to put the postcode on the map.

Now this is pretty simple stuff, but it seems I have to jump through hoops to get this to work. I’ve seen examples of binding to pageshow/pagecreate events, but I want my script to run only on the map page. The pageshow/create events end up firing on every page, not what I want!!

So this really comes down to:

  1. Running a snippet of JavaScript on a SPECIFIC page being shown.
  2. Dynamically calling some JavaScript with the postcode from the model.

How can I do this? I’ve even thought about trying Sencha touch to say how it goes about managing this.

  • 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-05-24T23:42:49+00:00Added an answer on May 24, 2026 at 11:42 pm

    I think I have the answer I was after. Although the rel=”external” AFAIK forces a non-AJAX load of the page and therefore runs any script in the head section, this is missed in subsequent requests. After the first AJAX request made by jQM, the contents of the page are pulled in from its internal cache, without running any script.
    I think the jQM site has added a page that describes this behaviour:

    http://jquerymobile.com/demos/1.0b2/#/demos/1.0b2/docs/pages/page-scripting.html

    As Phill mentioned above, the live event can be used in the JavaScript of the main startup page. Just ensure the div with the data-role=”page” id matches with what you are binding the ‘pagecreate’ event to:

    $('#aboutPage').live('pagecreate',function(event){
      alert('This page was just enhanced by jQuery Mobile!');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string

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.