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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:17:47+00:00 2026-05-29T06:17:47+00:00

So I am using Jquery mobile with great success except for one issue. Now

  • 0

So I am using Jquery mobile with great success except for one issue.
Now every time a dynamic content page is navigated to by a user no matter what content displays, there is always a button at the bottom that when clicked emails the content to the address specified; works great.
Now the first time a page is loaded, the click fires the event once. On the second visit its fired twice, third 3 times, etc. you get the point. I’ve scoured the net and implement every fix I could come across, such as using “pagecreate” instead of “pageinit”, binding, unbinding, removing the div, turning off caching in the DOM but nothing works. The only success I’ve had is using .one() on the click but it needs to be fired if clicked again. Here is the structure. I have to .js files that load each with this to start

$( "#page" ).live( "pageinit", function() { 

Now I had the email function and other stuff in one file, but it makes it easier to separate them and I heard it does not matter. Now, here is the email function called in the pageinit

$('.eb').live('click', function() {
        var id = $('.eb').attr('id');
        var to = $('#recipient').val();
        var message = $('#email').html();

        var atpos = to.indexOf("@");
        var dotpos = to.lastIndexOf(".");
        if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= to.length) {
            alert('Please enter a valid email address!');
            return false;
        } 

        if(to.length == 0) {
            alert('Please enter a valid email address!');
            return false;
        } 

        $.mobile.showPageLoadingMsg();

        $.post('./services/service.email.php', { id: id, to: to, message: message}, function(data) {
            if(data.success == true) {
                $.mobile.hidePageLoadingMsg();
                alert('Your recipe has been sent!');
                $('#recipient').val('');
                return true;
            } 

            if(data.success == false) {
                if(data.fail == 1) {
                    alert('An error has occured sending your recipe. Try again soon!');
                    return false;
                }

                if(data.fail == 2) {
                    alert('Please enter a valid email address!');
                }
            }
        }, 'json');
            return false;
    }); 

Everything works flawlessly except the incremental firing of the .click on each new page.
Can anyone lead me in the right direction?

  • 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-29T06:17:49+00:00Added an answer on May 29, 2026 at 6:17 am

    I solved this by realizing the issue was with the div itself, #page.
    This page was loaded with dynamic content but the id never did, so somewhere along the line it cached somewhere and was fired incrementally on each new visit by one.
    I just added some PHP code to create a unique div id on each page load.

    <?php $id = uniqid() ?>
    <div id="<?php echo $id; ?>">CONTENT</div>
    

    This solved the problem and it fires only once no matter how may page reloads there are.

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

Sidebar

Related Questions

I am using jQuery Mobile and have few pages in one HTML page. When
I'm using JQuery-Mobile. On specific child page loads, I want to perform one JavaScript
Created a phonegap application using jQuery Mobile. Everything is working great for the most
I started using jQuery Mobile some time ago, and as those that know jQuery
Current developing an iPhone app using jQuery mobile, everything is looking great however when
I'm using jQuery Mobile and trying to figure out how to change a page
I'm developing a site in jQuery mobile (jQM). It's great, but one thing is
I'm using jQuery Mobile on an MVC 3 website. Working well except that I
I'm using jquery.mobile-1.0.1. I'm trying to make the page reload when clicking on the
I've built a Jquery Mobile Android App using Phonegap which contains a form with

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.