Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

postpone parsing

Help
2008-07-11
2013-04-29
  • I've got a page with lots of formulas, but at the beginning, none of them are visible. They all reside in divs which are hidden and only made visible by some JavaScript links.

    What I'd like to do is to postpone jsMath parsing until a div is opened and then invoke jsMath.ProcessBeforeShowing on the div in question. Yet, I don't find how to disable the initial parsing of the whole file. What did I miss?

     
    • I assume you are using jsMath/easy/load.js, which doesn't have an easy way to disable the initial processing.  Here's an idea that may work for you, however.

      Edit your easy/load.js file and add

      jsMath.NO_OP = function () {};

      just before the comments at the bottom that say don't alter below them, and then modify the "method" field above to be

      method: "NO_OP",

      That should cause jsMath not to translate anything during the onload handler, and you can call jsMath.ProcessBeforeShowing whenever the mathematics appears.

      Hope that helps.

      Davide

       
    • Thanks, that works.