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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:20:34+00:00 2026-06-05T23:20:34+00:00

That sounds complicated, doesn’t it… actually it’s quite easy: I have a multi-language app

  • 0

That sounds complicated, doesn’t it… actually it’s quite easy:

I have a multi-language app and changing languages requires to reload the page.

I want users to
a) be able to change languages without rel=”external”ing the link (restarting the app)
b) do this from any page, so my link will only include the language parameter ?lang=EN

I have been fiddling with this forever, also getting some help from JQM devs and trying to stick close to this example on dynamic pages from the JQM docs.

The following solutions works so-so. See my question below:

$(document).on( "pagebeforechange.lang", function( e, data ){
    // just strings
    if (typeof data.toPage === "string") {  
        if (data.toPage.indexOf("?lang=") > -1) {
            console.log("language change")
            // stop here
            e.preventDefault();
            e.stopPropagation();

            var toUrl = $.mobile.path.parseUrl( data.toPage );
                viewSwitch  = toUrl.search.replace( /.*lang=/, "" ),
                form = "",
                service = "some_coldfusion_cfc_to_load_new_language.cfc",
                method = "locale",
                returnformat = "JSON",
                targetUrl = toUrl.filename,
                // fake submit
                formdata = "form_submitted=lang&viewSwitch="+viewSwitch+"&method="+method+"&returnformat="+returnformat,
                successHandler = function() {       

                    alert("changed language successfully")
                    // now we changepage
                    $.mobile.changePage( targetUrl, { 
                        reloadPage: true,
                        transition: "fade",
                        allowSamePageTransition: true
                        });
                    };
            // send AJAX to update language server side    
            // page will reload on success
            ajaxFormSubmit( form, service, formdata, targetUrl, successHandler );
            }
        } 
    });

Ok. This works, but… the page is added as a new page to the DOM (with data-external-page=”true”, so when I click the next page, the page will be removed.

Question:
How do I make this reloaded page the new “anchor” page = the page that stays in the DOM? I can remove data-external-page, but what other things do I need to do? Set Base?…

Thanks for any hints!

  • 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-05T23:20:36+00:00Added an answer on June 5, 2026 at 11:20 pm

    You can reload a page pretty easily using $.mobile.changePage() as long as you are reloading an external page (not a pseudo-page of a multi-page template):

    $.mobile.changePage('myPage.cfm?lang=EN', {
        reloadPage : true
    });
    

    This will request a new page from your server which can output the content in whatever language is selected, then removes the current version of this page in the DOM and finally adds the new version to the DOM.

    Documentation for reloadPage flag: http://jquerymobile.com/demos/1.1.0/docs/api/methods.html

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

Sidebar

Related Questions

I have built an app that plays lots of sounds the easy way: AudioServicesPlaySystemSound(someSoundID);
changing a static resource during runtine is something that sounds not possible. I have
That sounds pretty odd but i have this cod and i need to convert
I am using the AVAudioPlayer framework, and I have several sounds that play one
Yes that sounds overly complicated. I am trying to mine data from pages on
I have a set of core, complicated JavaScript data structures/classes that I'd like to
Let's say I have an iPhone app that has a UIWebView. Is it possible
In iOS browser (safari) sounds that are triggered by events are blocked (on ​​click
OK, that question sounds maybe a little confusing so I'll try to explain it
Any tutorials on how to make a slider for cocos2d that controls sounds that

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.