MathJax stops working once the js cached in the browser - javascript

I have this formula: ({\Delta ^{ - 1}} - T{V_0})
It works perfectly fine when I open the 1st the webpage. As soon as i refresh or open it again, the formula is diplayed in it raw format.
When I remove the browser cache, it work again the next time.
Any idea?
I have tried with Firefox, Chrome.
Thanks.

If you have in-lne configuration, make sure it is before the script tag that loads MathJax.js itself. If it comes after, MathJax may not be able to locate it when it needs it. This can happen when MathJax is in cache, as MathJax can get to the point where it looks for the configuration earlier, and the configuration block might not be available in the DOM yet. So make sure it comes first, as documented.

Thanks for your help Davide, but I figured out what the problem was. In fact, one part of the page was loaded with Ajax, so mathjax was running before the page was loaded. What happened from time to time, is that when I cleared the cache, the ajax page was loaded a bit earlier that the mathjax script, so it worked. What I did is that I reloaded mathjax once the ajax page was loaded and everything works as a charm.
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

Related

jQuery.getScript doesn't load after a page reload?

I am trying to debug some code which loads a script with jQuery like this
$.getScript('src/myscript.js', function(){ // start page });
The majority of the time, everything works fine. But some users report intermittent problems with the page not starting. Based on logs I have added to the code, it is clear that for some users, the load callback is never triggered again after they load the page a second time. Clearing their cache removes the problem, but every subsequent reload of the page...it stops again. Other users report intermittent problems, same log results. The user who always has the problem is using Chrome on a Mac.
Anyone had problems like this? I can't find anything in the docs or Googling which would suggest a possible reason..

Issue in javascript loader

I am having a strange problem i.e., when I am opening my website a loader is loaded and then homepage displays. Now I am navigating from home page to different page, everything is fine . The problem arises when I am getting back to the home page the loader is again loading.
In normal situation it should not load. Not able to find out the reason. I am running the website locally so cant provide the url
window.onload() I have used.
The Window.onLoad() event ALWAYS triggers when the page finishes loading.
http://www.w3schools.com/jsref/event_onload.asp
What is the reason to think that going to your page won't trigger onLoad() the second time? The browser won't know the difference whether it is the first, second, or 500th time.

javascript - different behaviour on page refresh

I have a really weird problem.
I have a site (running wordpress), and I use jquery roundabout plugin.
When I visit the site with the address bar, the site is displayed fine. When I'm already in the site and I hit refresh - everything is messed up. I checked in both chrome and firefox, and I get the same result. In IE there is no problem.
Also, I noticed that the problem occurs only when doing a soft refresh (F5) and it's ok when doing a hard refresh (Ctrl+F5)
You can check for yourself in my test site
http://50.112.34.111
try to press enter in the address bar a few times - should display ok. try to refresh - and you'll see the problem...
First of all I would try to put the JS includes (<script.../>) in the header AFTER all CSS includes! That might already help. Since the CSS might influence your JS, JS has to know all CSS before it gets loaded.

Breakpoint on DOM load

I am trying to use a really old page on a website I do not have control over (so I can't edit it's resources).
The problem is that it is redirecting the page via javascript (to a 'we don't support this browser' rubbish), via setting document.location before I can set any breakpoints to then debug/workaround.
Is it possible to break as soon as the DOM loads, preferably in chrome?
Disabling javascript stops the redirect, but chrome does not allow me to view any scripts to then place break points.
FireBug has a "Break On Next" feature. I'm not sure if it will work in your case, but it might be worth giving it a quick try: https://getfirebug.com/doc/breakpoints/demo.html#suspend
It seems like Chrome likes to do something to prevent you from seeing the code when you click the stop button before the page finishes loading. It'll say something like window.script123456738391=1;. That makes it so you can't set a breakpoint at the right spot inside the code, especially if there's a redirect on the page before you get a chance to pause it.
What I found you can do is set a breakpoint on that first line. Next time you load the page it will break on the very first line, regardless of what it is. Then you can see all the code the page would load and set breakpoints wherever you want :)

failing to render in extjs

Sometimes when I open a page, it has blank only, but when I refresh the page or the browser, the page can be rendered.
I want to know why it happened and how the problem happened so much!
Some code from your HTML could be helpful but this is what I'm thinking:
It may have something to do with the order in which you are including your JS files. Be sure to load ext-base.js then ext-all.js before your own javascripts. You will then need to load any other resources required for your layout to render.
I'm thinking that on the first (blank) load, it fails to load the screen because of the resources are not coming in at the right time. When you reload the page, the scripts load because they have already been cached by the browser.

Categories