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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:31:30+00:00 2026-06-18T05:31:30+00:00

My question is pretty much exactly like in jQuery code doesn't work if I'm

  • 0

My question is pretty much exactly like in jQuery code doesn't work if I'm using a local jquery.js file, why?.

However, the solution given there, doesn’t work for me.

I created a file with UTF-8 encoding, but it will still not render correctly.

Using the external jQuery files work though.

Here is my MWE:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <link href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.css" rel="stylesheet">
    <link href="http://code.jquery.com/mobile/1.2.0/css/jquery.mobile.structure-1.2.0.min.css" rel="stylesheet">
    <script charset="utf-8" src="js/cordova-2.2.0.js" type="text/javascript"></script>
    <script charset="utf-8" src="js/index.js" type="text/javascript"></script>
    <script charset="utf-8" src="js/jquery-1.9.0.min.js" type=
    "text/javascript"></script>
    <script charset="utf-8" src="js/jquery.mobile-1.2.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $('div.ui-page').live("swipeleft", function() {
                var nextpage = $(this).next('div[data-role="page"]');
                if (nextpage.length > 0) {
                    $.mobile.changePage(nextpage, {
                        transition: "slide",
                        reverse: false
                    });
                }
             });
             $('div.ui-page').live("swiperight", function() {
                 var prevpage = $(this).prev('div[data-role="page"]');
                 if (prevpage.length > 0) {
                     $.mobile.changePage(prevpage, {
                         transition: "slide",
                         reverse: true
                     });
                 }
             });
         });       
    </script>
</head>

<body>
    <div data-role="page">
        <div data-role="header">
            <h2 class="ui-title"><strong>Page one</strong></h2>
        </div>

        <div data-role="content">
            <strong>You are in page one.</strong>
        </div>

        <div data-id="foo1" data-position="fixed" data-role="footer">
            <div data-role="navbar">
                <ul>
                    <li><strong><a data-icon="home" href=
                    "index.html">Home</a></strong></li>

                    <li><strong><a data-icon="info" href=
                    "b.html">Info</a></strong></li>

                    <li><strong><a data-icon="gear" href=
                    "#">Settings</a></strong></li>
                </ul>
            </div><!-- /navbar -->
        </div><!-- /footer -->
    </div>

    <div data-role="page">
        <div data-role="header">
            <h2 class="ui-title"><strong>Page two</strong></h2>
        </div>

        <div data-role="content">
            <strong>You are in page two.</strong>
        </div>

        <div data-id="foo1" data-position="fixed" data-role="footer">
            <div data-role="navbar">
                <ul>
                    <li><strong><a data-icon="home" href=
                    "index.html">Home</a></strong></li>

                    <li><strong><a data-icon="info" href=
                    "b.html">Info</a></strong></li>

                    <li><strong><a data-icon="gear" href=
                    "#">Settings</a></strong></li>
                </ul>
            </div><!-- /navbar -->
        </div><!-- /footer -->
    </div>
</body>
</html>
  • 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-18T05:31:31+00:00Added an answer on June 18, 2026 at 5:31 am

    .live has been deprecated in jQuery since v1.7, and has been removed in v1.9.

    You should replace it with .on().

    .on has 2 syntaxes for binding elements, whereas .live only had 1.

    If the element exists at the time you are binding, you do it like this:

    $('.element').on('click', function(){
      ...
    });
    

    You can even use the shorthand:

    $('.element').click(function(){
      ...
    });
    

    If the element does not exist at the time, or new ones will be added (which is what .live was normally used for), you need to use “event delegation”:

    $(document).on('click', '.element', function(){
      ...
    });
    

    NOTE: You want to bind to the closest static element, not always document.

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

Sidebar

Related Questions

My question is pretty much exactly as the title states. I need to somehow
The question pretty much says it all. I'd like to be able to search
Well the title Question pretty much sums it up, But I'd like to detail
The question pretty much says it all. I have a joomla website and I
The question pretty much says it all. What supported JVM GC should we use
The title of the question pretty much states the problem. Is it possible?
As the question pretty much sums up, I'm doing a presentation on some of
My question is pretty much summed up in the subject.The context is a problem
The question is pretty much self-explanatory. I Googled many sites, many methods, tried many
This question does pretty much what I want to accomplish, but my table is

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.