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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:22:18+00:00 2026-05-31T23:22:18+00:00

I have 2 pages that I linked using swipeleft and swiperight event(back and forth)

  • 0

I have 2 pages that I linked using swipeleft and swiperight event(back and forth) but when I swipe to the other page, jquery doesn’t fire the pageinit event and I am left with just the header and footer. Should I be using the changePage event or should I be using the loadPage event? I know that there is a bug in the other version of jquerymobile where pageinit event does not fire but I am already using the RC1 which has already solved it but the event is still not firing. what is stopping it from firing? Thanks in advance.

Code is as follow:

      <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>esports</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<link rel="stylesheet" href="jquery.zrssfeed.css" />
</script>

<style>


</style>
</head>
<body>
<!-- index -->
<div data-role="page" id="index">
    <div data-role="header">
        <h1>esports times</h1>
    </div>
    <!--/header-->
    <div data-role="content" id="content">
        <div id="currentFeed">teamliquid. &nbsp; skgamin</div>
        <ul id="rssFeed" data-role="listview">
        </ul>
    </div>
</div>

</body>
</html>

<!-- load javscripts here-->
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js">     </script>
<script src="jquery.zrssfeed.js"></script>
<script>
    $('#index').bind("pageinit", (function () {
        $('#rssFeed').rssfeed('http://feeds.reuters.com/reuters/oddlyEnoughNews', {
            limit: 10,
            date: false,
        });
    }));

    $('#index').bind("swipeleft", function () {
        $.mobile.changePage("teamliquid.html", "slide", true, false);
    });
</script>

<!-- /javascript-->
  • 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-31T23:22:19+00:00Added an answer on May 31, 2026 at 11:22 pm

    Change page is what your looking for. Load page just loads it into dom so you can manipulate before you actually show the page.

    When binding to page init make sure your binding your pageinit event using a unique id. They cannot both have id=”#index”. Also make sure you bind page init to each page. Your code would only have the pageinit firing for just the #index page and not the teamliquid.html.

    Use the following in the <head></head> of your documents:

    $(document).on('pageinit','#index', function(){
        $('#rssFeed').rssfeed('http://feeds.reuters.com/reuters/oddlyEnoughNews', {
          limit: 10,
          date: false,
        });
    });
    $(document).on('pageinit','#otherpage', function(){
        ... This would be for the other page you are referring to....
    });
    $(document).on('swipeleft','#index', function(){
        $.mobile.changePage("teamliquid.html", { transition: "slide" });
    });
    $(document).on('swiperight','#otherpage', function(){
        $.mobile.changePage("index.html", { transition: "slide" });
    });
    

    or to get pageinit for fire for every page

    $(document).on('pageinit','[data-role=page]', function(){
        ....ground breaking code...    
    });
    

    As of jquery 1.7 bind, live, and delegate all use the .on() method. It is the recommended way of binding your pageinit for JQM. You can also do cool things like replacing ‘#index’ with ‘[data-role=page]’ to make your code fire on every page. Here is a JSfiddle demonstrating that this indeed did work. http://jsfiddle.net/codaniel/cEWpy/2/

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

Sidebar

Related Questions

1) I have a ReportViewer control on a page that's linked to a ServerReport
I have some pages that use the master page and apply a theme. Some
I have some pages that I don't want users to be able to access
I have the pages that I want to set as a goal in Google
I have some pages that reference javascript files. The application exists locally in a
I have several aspx pages that can be opened either normally (full screen in
I have a Pages table that stores all my view urls and this table
I have a bunch of ASP.NET web pages (that have a standard layout) that
I'm running tomcat and have some jsp pages that display a subset of a
I have a couple of pages that are bulky due to the viewstate. I

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.