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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:04:32+00:00 2026-05-23T03:04:32+00:00

I have an app that allows users to win prizes. To win a prize

  • 0

I have an app that allows users to win prizes. To win a prize they need to get to a page like this: www.myUrl.com#isAWinner where #isAWinner is my mobile page. I am worried that someone will think of just entering that url and going directly to the winner page without actually winning. To fix this I attempted to do this:

<!-- Show this if the user is a winner -->
<div id = "isAWinner" data-role = "page">
    <p>YOU WIN!!!</p>
    <!-- Invisible link -->
    <a href = "#beforeLogin" id = "goBack" class = "InvisibleLinks"></a>
    <!-- Ensures that the user does not just enter #isAWinner to the end of the URL -->
    <script type="text/javascript"> reallyAWinner()</script>
</div>

function reallyAWinner () {
    alert(isAWinner);
    //Check to see if they really are a winner
    if (isAWinner == false) {
        //Not really a winner. Send back to login
        $('#goBack').click();
    }
}

The problem is that the alert is hit when the page initially loads, but if i try to go to that URL afterwords, then the method is not hit again.

Am I not understanding how JQuery mobile works? Will it only hit that reallyAWinner() method when the whole HTML page loads, and not when the isAWinner page loads? If so, is there another way I can check if the user is really a winner only when the isAWinner page loads?

Edit: here is a little more info. When I enter the method initially without loading the first page, the alert in reallyAWinner() will fire before an alert I have in my document.ready method, making the $('#goBack').click(); not work (Because mobile is not loaded)

  • 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-23T03:04:33+00:00Added an answer on May 23, 2026 at 3:04 am

    If you have enabled ajax method calls the function reallyAWinner() will be called when your initial page is called.

    What you can do to call you function reallyAWinner() only when #isAWinner page is loaded you can register a “pageshow” event on the id of your page.

    So you can do the following:

    $('#isAWinner').live('pageshow', function () { reallyAWinner();  });
    

    From jQueryMobile Documentation:

    pageshow: Triggered on the page being shown, after its transition completes.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client who would like an iphone app that allows users to
I have an existing web app that allows users to rate items based on
We have a WPF app that allows our users to download encrypted content and
I have a SQL interface page in my classic ASP web app that allows
We have an app that allows users to send e-mails from our system. It
I have a Silveright app that allows users to specify filters on a few
I have a Rails app that allows users to build up a network structure
I am wanting to have an In-App Purchase that allows my users to import
I have a web app (java, tomcat) that allows users to generate reports through
I have an app that allows users to generate objects, and store them (in

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.