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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:52:07+00:00 2026-05-23T09:52:07+00:00

There seems to be some issues when combining MathJax and jQuery Mobile on the

  • 0

There seems to be some issues when combining MathJax and jQuery Mobile on the same page. Sometimes the MathJax renders correctly and other times it does not – and this can happen to the same page.

The HTML that loads both of them looks like this:

<script type='text/javascript' src='http://code.jquery.com/jquery.min.js'>
</script> 
<script type='text/javascript'
        src='http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js'>
</script> 
<link rel='stylesheet' type='text/css'
      href='http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css' /> 
<script src='/beta/mathjax/MathJax.js'>
</script>

You can see an example page here: http://stackmobile.com/beta/math.stackexchange.com/questions/view/?id=47772

Edit: It seems to be a problem with MathJax not recognizing a new page being loaded via AJAX – here is an example that doesn’t seem to work: http://stackmobile.com/beta/#/beta/physics.stackexchange.com/questions/view/?id=11678

  • 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-23T09:52:08+00:00Added an answer on May 23, 2026 at 9:52 am

    Well I found a solution… and it goes something like this:

    • First assign unique numbers to the pages. Since these pages are generated in PHP, this can be accomplished by using uniqid().
    • Assign the following function the the pageshow event:

      $('#page_id').live('pageshow', function(event, ui) {
          var script = document.createElement('script');
          script.type   = 'text/javascript';
          script.src    = 'path_to_mathjax/MathJax.js';
          script.onload = callback;
          document.getElementsByTagName('head')[0].appendChild(script);
      });
      

      This loads MathJax and inserts it into the DOM – this script should be included within the page element. Also note that we mention a ‘callback’. This will be called when the script loads.

    • This function (the callback) needs to go outside of any pages. This will prevent it from being included twice after a new page is loaded.

      var mathjax_loaded = false;
      function callback()
      {
          if(mathjax_loaded)
              MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
          else
          {
              MathJax.Hub.Startup.onload();
              mathjax_loaded = true;
          }
      }
      

      There’s a lot here. First of all, we keep track of whether this callback has been called once before. If not, we tell MathJax to parse the page as if it were invoked from the window.onload event. If this has already happened (and we’re on a new page) then we simply need to have MathJax run through the new page.

    I’m probably missing something and there may be a better way of doing this. But I haven’t found any other way that works.

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

Sidebar

Related Questions

I have a survey on a website, and there seems to be some issues
I'm using EPIC, but it seems to have some drawbacks. Are there any other
I'm having some strange issues with .removeClass() and .addClass() in jQuery. Specifically it seems
There seems to be some debate over refactoring to utilize java generics within my
There seems to be some controversy on whether the number of jobs in GNU
I've had some experience with Pygame, but there seems to be a lot of
I am trying to read command lien argument but it seems there is some
Is there some easy way to pad Strings in Java? Seems like something that
Is there some valid purpose to minifying before compressing? It seems highly unlikely that
Building a solution from Visual Studio in mono develop seems to have some issues.

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.