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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:00:30+00:00 2026-05-26T15:00:30+00:00

I m using jquerymobile, I want to put content inside the page fetched by

  • 0

I m using jquerymobile, I want to put content inside the page fetched by $.mobile.changePage(‘external.html’) or page called directly when we clicked on link, like:

My app has two physical files, index.html and external.html.
Index.html anchor link call external.html, but during changing the view from index.html to external.html, I m getting json from another server that I want to use in that

$.mobile.changePage(‘external.html’) is fetching page properly but display it imediately and ajax call is not even completed.

var ProductDetailEvent = function(){

     thisProd = $(this);
     $.mobile.showPageLoadingMsg();
     Product.id   = thisProd.attr('data-id'); 
     Product.name = thisProd.find('h3').html(); 


    $.mobile.changePage( "productView.html", {
        transition: "pop",
        reverse: false,
            changeHash: false
        });
}

    ////LOAD DATA FOR E PAGES::4
$(document).bind( "pageload", function( event, data ){


            if(data.page[0].id != null)
            switch(data.page[0].id)
            {
                case 'detailView':

                    var pageData = {
                        page: data.page,
                        header: Product.name,
                        url: 'pDetail&productId='+Product.id,
                        loadDataCB: function(_resp){
                            strHtml = '';
                            img = 'http://10.0.1.64/magento/media/catalog/product/' + _resp.image;

                            strHtml += '<div style="text-align:center"><img src="'+img+'"  width="50%" /><br/><b>Description:</b>'+_resp.short_description;
                            strHtml += '</div><br/><input type="button" value="Add to Cart" data-role="button" /><br/><div class="ui-grid-a ui-bar-d">\
                                        <div class="ui-block-a"><div class="ui-bar ui-bar-d" >Price</div></div>\
                                        <div class="ui-block-b"><div class="ui-bar ui-bar-d" >'+_resp.price+'</div></div>\
                                        <div class="ui-block-a"><div class="ui-bar ui-bar-d" >Weight</div></div>\
                                        <div class="ui-block-b"><div class="ui-bar ui-bar-d" >'+_resp.weight+'</div></div>\
                                        </div>';
                            return  strHtml;        
                        }   
                    };

                    loadExternalView(pageData);

                break;


                case 'externalView':

                break;
            }
        });


    ////Load List::Inner Pages///
    var loadExternalView = function(_data)
    {

            var NPage  = _data.page;
            pHeader    = NPage.find('.header h1').html(_data.header);
            var pContent = NPage.find('.content');
            ServerCall(_data.url,function(result){  
                var strHtml = _data.loadDataCB(result);
                pContent.html(strHtml);
            }); 
    };

var ServerCall = function(_url,callback)
{
    $.ajax({
           type: "POST",
           url: 'consumeservice/magentoapi.php?option='+_url,
           data: '',
           dataType:'json',
           success: 
             function(result) {
                callback(result);
           },
            error: function (data, status, e)
            {
                alert("error:"+e);
            }
        });
};

External Page HTML:

    <!DOCTYPE html> 
    <html> 
      <head> 
         <meta charset="utf-8" /> 
      </head> 
      <body> 
         <!-- Begin Page 4 --> 
        <div id="detailView" data-role="page"> 
          <div class="header" data-role="header" data-icon="back" data-theme="a">
            <h1></h1>
          </div>
          <div class="content" data-role="content">
                <div class="ui-grid-a ui-bar-d">
                    <div class="ui-block-a"><div class="ui-bar ui-bar-d" >A</div></div>
                    <div class="ui-block-b"><div class="ui-bar ui-bar-d" >B</div></div>
                </div>
          </div> 
        </div> 
         <!-- End Page 4--> 
      </body> 
    </html> 

I don’t want to create too many internal pages b/c it will affect the performance and increase the page size.

When external page is called it immediately display the page on screen, I want to change it content and then render the page.

Thanks

  • 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-26T15:00:31+00:00Added an answer on May 26, 2026 at 3:00 pm

    Do you want to change the content BEFORE showing the page? If so, bind ‘pagebeforecreate’:

    $('#pageID').live('pagebeforecreate',function(){
        //Change content
    });
    

    Or do you want to show the page, then change the content and update the page? If so, use .trigger("create") on the div:

    //Change content first
    $('#pageID').trigger('create');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using phone gap and some jQuery mobile framework. I want to put some
I'm using JQuery-Mobile. On specific child page loads, I want to perform one JavaScript
I am using jquery Mobile 1.0. I have this html code. <label for=slider class=ui-hidden-accessible>
I am using Jquery mobile, and I have these two select lists, I want
In order to load a jQuery mobile page using an anchor tag, one just
I am using jquerymobile for developing app. I want to change the UI(button,list) colors,text
I am using the jquerymobile for developing app. Here I want to move the
I am using ASP.NET MVC along with JQueryMobile in a web app. I want
I am building an app for mobiles, using jquery mobile framework. I want to
I'm using jquery-mobile with Ruby On Rails. I want to create a button link

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.