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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:36:34+00:00 2026-06-09T07:36:34+00:00

I am trying to load a page via an ajax call using mobile.changepage shown

  • 0

I am trying to load a page via an ajax call using mobile.changepage shown below:

mobile.changePage( "index.html", {transition: "slide", reloadPage: true, data: id})

I’ve tried to use on the index.html all the functions such as:

$( '#mainMenu' ).live( 'pageinit',function(event){var movie_id = location.search;});

The page gets loaded but I can not get the value of “id” on the index.html page, just if I hard refresh it works.

What am I doing wrong?

Thanks
Rodrigo

  • 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-09T07:36:36+00:00Added an answer on June 9, 2026 at 7:36 am

    Assuming that you will pass a single parameter to page2, you could use location.search in page2 to get the movie variable, but I found that it doesn’t work well for regular browsers. So, in the result page, you need to parse $(this).data('url').

    Also, the script code in page2 must be inside the DIV#page2 block, because what is in your header HTML WON’T be changed when next page is changed (as another member noticed).

    The script blocks:

    page1

    <script language="javascript">
    
        $( '#mainMenu' ).live( 'pageinit',function(event){
            $('.btnTxtSearch').bind('click',function () {
                var movieName = $('#txtMovieTitle').val();
                if (!movieName || movieName.length == 0 || movieName == null) {
                    alert('Please insert a title before clicking the button');
                    return false;
                } //end of if
    
                $.mobile.changePage( "page2.html", {transition: "slide", reloadPage: true, data: movieName}); 
    
            });
        });
    
    </script>
    

    page2

    <script language="javascript">
    //Without this pageinit may be called multiple times in back and forth use case.   
    $('#page2').die( 'pageinit');
    
    $('#page2').live( 'pageinit',function(){
        var movieName = $(this).data('url').split('?')[1];
        //Debug:
        alert(movieName);
    });     
    
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to load a page via ajax and then slide that content horizontally
I am trying to load a mobile version of the web page using a
Im using jquery to call a page via ajax. I have some jquery functions
I'm trying to load page content into a div via Ajax when a select
I'm trying to load one page into another using the .load() method. This loaded
I'm trying to load a page using the load() function, the problem is that
I'm trying to load a local web page executing: var html = document.open('google.html'); document.documentElement.innerHTML
I am trying to load mschart in my aspx page(SalesOverview.aspx) using jQuery.load() method, I
I'm trying to programmatically load a web page via the WebBrowser control with the
I am trying to perform a simple JQuery AJAX page load within a CodeIgniter

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.