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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:41:40+00:00 2026-06-18T03:41:40+00:00

why does the test message shows twice on: <!DOCTYPE html> <html> <head> <meta name=viewport

  • 0

why does the test message shows twice on:

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
    <script type="text/javascript">
        alert("Test");
    </script>
</body>
</html>

I copied the headers from from http://jquerymobile.com/demos/1.2.0/docs/about/getting-started.html and as I started doing some examples I noticed that my javascript methods where being called twice.

Here is the code in JsFiddle:

http://jsfiddle.net/LsxBW/2/

  • 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-18T03:41:42+00:00Added an answer on June 18, 2026 at 3:41 am

    As Explosion Pills perfectly stated you have to play by jQM rules. At least:

    • Use appropriate jQM markup for a page or pages
    <div data-role="page" id="page1">
        <div data-role="header">
            <h1>Page Title</h1>
        </div><!-- /header -->
        <div data-role="content">    
            <p>Page content goes here.</p>        
        </div><!-- /content -->
        <div data-role="footer">
            <h4>Page Footer</h4>
        </div><!-- /footer -->
    </div><!-- /page -->
    
    • Use pageinit event instead of jQuery ready handler.
      So instead of
    $(function() {   
        alert("Test");
    });
    

    use

    $(document).on("pageinit", "#page1", function(){
        alert("Test");
    });
    

    jsFiddle is here

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

Sidebar

Related Questions

If ASP.NET MVC2 code below shows message Test in Create controller response. In Mono
I keep getting the following error message at compile time: The name 'Message' does
How does one test a method that does some interactions with the local D-Bus
I'm trying to understand why the following test does not fail. In this simplified
Facebook does not allow callbacks on ip addresses. So how does one test their
This question is spawned from the partial answer to JSF2: why does empty test
use Service layer to persist data into database. But the Unit Test does not
Why does the expression: test = cast(strtrim('3'), 'uint8') produce 51? This is also true
How does one unit test that a new thread was spawned for a Runnable
How does one rigorously test a site for both security and speed? What are

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.