English 中文(简体)
• 在一个流动地点将吉乐运动和马蒂克斯混为一谈?
原标题:Combining jQuery Mobile and MathJax on a mobile site?

在将MathJax和j Query Mobile公司合并在同一页似乎有一些问题。 有时,MathJax使情况正确,其他时候则不正确,这种情况可能在同一页。

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>

http://stackmobile.com/beta/math.stackexchange.com/questions/view/?id=47772"rel=“nofollow”http://stackmobile.com/beta/math.stackexchange.com/questions/view/?id=47772

<><>Edit>: 看来,MathJax没有承认通过日本宇宙航空研究开发机构装上新的一页,这里的例子是:

最佳回答

我找到了解决办法。

  • First assign unique numbers to the pages. Since these pages are generated in PHP, this can be accomplished by using uniqid().
  • 指定以下职能<代码>show 活动:

    $( #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);
    });
    

    装上MathJax并插入OM,这一文字应当列入。 我们还注意到,我们提到了挫折。 文字装满时将要求这样做。

  • 这一职能(接线)需要进入任何网页out>。 这将防止在装上新页后再加两页。

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

    这里有很多东西。 首先,我们不断跟踪这一挫折是否曾被一度要求。 否则,我们就把MathJax说成在window.onload活动中加以引用。 如果这种情况已经发生(而且我们又翻了一页),那么我们就完全需要由MathJax接过新页。

我很可能没有东西,这样做可能更好。 但是,我没有发现任何其他行之有效的方法。

问题回答

Not sure if this is easier/better way to add a script but here is what I found:

(未测试) Maybe(利用你的职位:Combining j 移动站点上的优质移动电话和MathJax?

$( #page_id ).live( pageshow , function(event, ui) {
    $.getScript( http://path_to_mathjax/MathJax.js , function() { 
        callback(); 
    });
});

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




相关问题
Conflict between jQuery, Prototype, and plugins

I am trying to deconflict Prototype and jQuery in a rails app. I discovered that jQuery broke Prototype a good way into the app. I started the process by adding $jq = jQuery.noConflict(); to the ...

couchdb for /really/ distributed replica

let s say i want to implement a distributed database (each node being the replica of the others); i hear that cdb is able to easily sync between two nodes and at least support some form of conflict ...

How is this a conflict

i m just testing git to find out if i could use it for my work. I ran into a problem that seems small but could become a real one with the real code. My file looks like: text.txt 1 2 3 ...

bug when prototype and jQuery are both loaded

I have function in Javascript which works fine using prototype. The function is used to dynamicaly change a select field based on the selection of another field. var sizes_286 = new Array(); ...