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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:16:10+00:00 2026-05-26T00:16:10+00:00

I am using jQuery mobile for navigation, including back buttons, so the following is

  • 0

I am using jQuery mobile for navigation, including back buttons, so the following is set:

$.mobile.page.prototype.options.addBackBtn = true;

In order to use jQuery mobile navigation to get to pages linked from an HTML image map, I was using the following code, bound to pagecreate:

$(page).find('MAP').bind('click', function(e) {
    alert("Map click");
 });

$(page).find('AREA').bind('click', function(e) {
    alert("Area click");
    e.preventDefault();
    $.mobile.changePage($(this).attr('href'));
 });

What seems to happen is the first time my image map loads, everything works as expected, and when I touch one of the areas, I get both alerts, first “Area click” then “Map click”, and then the nice jQuery mobile nav animation takes me where I’m going.

However, whether I use jQuery mobile’s back button (enabled by the addBackBtn option above) or the browser’s back button to return to the image map, these events no longer seem to fire. The area objects neither cause their original, pre-override behavior of acting like a regular hyperlink, nor do I get any of my alerts.

This is in Webkit browsers on a couple of iOS and Android phones – somehow desktop browsers do not exhibit this issue.

Anyone know the bug/fix/workaround for having my HTML image map continue to work, even after it’s been navigated away from and back again by jQuery mobile? All help greatly appreciated.

  • 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-26T00:16:11+00:00Added an answer on May 26, 2026 at 12:16 am

    The issue turns out to be that, when you use jQuery mobile for navigation, it can sometimes end up injecting duplicate IDs into the DOM, which is why they advise you to never use IDs in the first place.

    Unfortunately, images must refer to their maps by id (or name), so using the above approach you can end up manipulating one map, while your img tag is pointing at another one with the same ID that is somewhere else in the DOM.

    The fix isn’t pretty, but it’s to set the id of the map to something unique, and then set the usemap attribute of the corresponding image, before trying to update the handlers of each map area.

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

Sidebar

Related Questions

In JQuery Mobile I am using changePage() to redirect back to a previous page,
I am using jquery mobile and phonegap. Here is my json result set getting
I'm using jquery.mobile-1.0.1. I'm trying to make the page reload when clicking on the
I am using JQuery Mobile Datebox as I am having the following problem. I
I am using jQuery Mobile and have few pages in one HTML page. When
I'm using jQuery Mobile and trying to figure out how to change a page
I'm using Jquery mobile framework. I have 2 html files which has two buttons
I'm using Jquery mobile, so ignore some of the following overdone css, its not
I a using jquery mobile to create a mobile web page. I defined a
I am developing a small app using jquery mobile. I have the following scenario

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.