I'm trying to include equations in my Qualtrics survey using LaTex, so I'm using MathJax. I've hincluded the following in the header so that it runs through all the pages.
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS MML_HTMLorMML">
</script>
This works great... but only for the first page when preview the whole survey! However, I can see the equations displayed on the other pages if I preview the question individually.
Someone else also had this issue with javascript in the header and resolved it by having no transition effects between the pages. I've tried this, but it doesn't solve my problem (although their script to suppress the Qualtrics logo at the bottom of each page worked for my survey by changing the transitions to none).
Any suggestion is appreciated. Thanks!
I thought this was a Qualtrics issue, but more of a MathJax rendering issue.
This was asked elsewhere under tags, and I found a solution.
By adding the following in my header, all was fixed... for now.
<script type="text/javascript">
MathJax.Hub.Queue(
["resetEquationNumbers",MathJax.InputJax.TeX],
["Typeset",MathJax.Hub]
);
</script>
Related
I need a solution to hide a image of external javascript.
I have a website. I am using a free tracker service to track my visitor. So, the tracker give me a code which I placed in footer of my site. But the script create a little image icon. Which is clickable. So, anyone can see my site data.
So, I want to use the tracker code, but hide the image. Which make sure only I'm able to view all of my site data. The javascript code is encrypted or much complex. So, I can't solve my problem. I google for similar questions. But answer is not specific. As, I am a beginner, I need details instruction.
I added the source code. here "jbahe" is my username. My site is https://jagobahe.com
Thanks in advance.
<script src="//t1.extreme-dm.com/f.js" id="eXF-jbahe-0" async defer></script>
You can hide the image with CSS
#eXTReMe-Free-jbahe {
display:none;
}
Or if you must use JS
document.getElementById('eXTReMe-Free-jbahe').style.display = 'none'
Hi I have a wordpress websitse. When I try to visit that site it breaks down full layout for minimum 2 seconds. I can't understand why this is happening. I tried to use Javascript to footer plugin.
Please suggest me what happened here. And what can I do in this situation.
I can see you're using Divi theme in your wordpress site. I believe the above problem is due to loading css at the end of body.
When I inspect your site, I am able to see main css file such as Divi/style.css (Parent theme style) is loading at the end of body. Hence I came to this conclusion. Try moving your css to head that would solve your problem.
Incase you're concern about site speed try moving css one by one to head.
This is because you are writing the link rel="stylesheet" which is poor poor practice. Add it in head and your problems will be solved.
Do not write your main stylesheet in body tag, if you do not want that effect.
Further reading
https://stackoverflow.com/a/16844668/17447
load external css file in body tag
I would greatly appreciate it if someone could shed some insight onto a problem I'm having.
The code below is from the footer of a WordPress website I run, and as you'll notice, the second script is invalid. I have no idea where that even came from or how to fix it, and I've searched through many WordPress PHP files (footer.php, index.php, page.php, etc.) to try to find the source, but I'm not sure where it is.
So my question is this: could someone tell me how to find the source of this script? In other words, how can I find out where that second line of code even comes from? I'm not a developer, so sorry if this is a dumb question. Here's the code for you to reference:
<script defer="defer" src="http://echidnainc.com/wp-includes/js/admin-bar.min.js" type="text/javascript"></script>
<script defer="defer" src="http://echidnainc.comhttp//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js" type="text/javascript"></script>
<script defer="defer" src="http://echidnainc.com/wp-content/plugins/easy-social-share-buttons/assets/js/easy-social-share-buttons.min.js" type="text/javascript"></script>
<script defer="defer" src="http://echidnainc.com/wp-content/plugins/easy-social-share-buttons/assets/js/essb-sticky-sidebar.js" type="text/javascript"></script>
<script defer="defer" src="http://echidnainc.com/wp-content/plugins/easy-slide-in/optin-forms-manager/js/placeholder.js" type="text/javascript"></script>
So to answer the general question I posed, to find the source of a line of code placed in the footer of a WordPress page, the first thing to try should probably be the one-by-one deactivation of plugins until the script disappears (and obviously, when the script disappears, then you know the last plugin to be deactivated was responsible). That worked for me.
And now for details on my specific situation's resolution:
A plugin, Speed Booster Pack, was causing the erroneous script:
<script defer=”defer” src=”http://echidnainc.comhttp//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js” type=”text/javascript”></script>
Either that erroneous script or another element of the Speed Booster Pack was interfering with another plugin I recently installed. I tried tweaking some PHP files in the Speed Booster Pack, but ultimately I just deactivated the plugin in order to solve the problem.
I browsed to each of the scripts you mentioned in your post (just pasted the link into my browser to see the JavaScript source). It doesn't seem to be any of those scripts that are adding the tag to Google's hosted version of jQuery.
My suggestion, without knowing the source of the plugins you have in your wordpress, is that one of the plugins is trying to include jQuery, and has an error.
As to why the scripts are loaded at the end of the page, this is a combination of the "defer" tag, combined with a common web development trick that placing tags at the end of the page body facilitates faster load times.
If you could refer to the source code for any of the plugins I don't mind checking to see which one, if any, have the typo. You yourself could attempt to remove plugins one by one to see if one causes the script tag to disappear, and boom, culprit.
The second script is invalid, because the url in the src="..." arrtibute is invalid. I assume you wanted to use jQuery, a JavaScript libary.
To fix that replace
src="http://echidnainc.comhttp//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"with src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"
The jQuery libary hosted by Google.
I have a Rails4 app which uses MathJax. I use MathJax CDN by placing the following line in the <head> section of my app/views/layouts/application.html.erb file:
<script type="text/javascript" src="path-to-mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
More information on: http://docs.mathjax.org/en/latest/start.html#mathjax-cdn
Because of Turbolinks, MathJax loads only on the homepage and won't load on other pages unless I refresh the page (which is not desirable). Instead I want MathJax to load only on /Math/New and Physics/Show pages. What should I do? (I don't want to deactivate turbolinks)
Thanks a lot for your help.
I was also struggling with the same issue since last few days. Finally figured out the way to solve this. Here is the explaination for the same:
If you are writing a dynamic web page where content containing mathematics may appear after MathJax has already typeset the rest of the page, then you will need to tell MathJax to look for mathematics in the page again when that new content is produced. To do that, you need to use the MathJax.Hub.Typeset() method. This will cause the preprocessors (if any were loaded) to run over the page again, and then MathJax will look for unprocessed mathematics on the page and typeset it, leaving unchanged any math that has already been typeset.
So the simplest solution is to add the following in app/views/layouts/application.html.erb file:
<script>
MathJax.Hub.Typeset();
</script>
Don't add this in head section. Add it after closing the body tag.
You can add data-no-turbolink only for that link to make it work as regular link, take a look at https://github.com/rails/turbolinks/#opting-out-of-turbolinks
Three great solutions can be found here: http://reed.github.io/turbolinks-compatibility/mathjax.html
While creating a website using Twitter Bootstrap's carousel, it seems that some scripts are interfering from it auto-sliding when the website is loaded. But it works fine once you click one of the controls in the carousel. It then slides every 5 seconds, the default time.
I'd rather not post a jsfiddle because of the size, so the production website will have to do (not sure if this is against the rules - otherwise I'll delete it).
Now there are some plugins I'm using (Newsletter and Contact Form 7) which also include scripts from jQuery. I'm not sure how to implement the noconflict from jQuery, or if it will even help.
Can anyone spot the problem?
I got this working by saving a copy of your site to my local drive, I moved the bootstrap .js file to the bottom of the file right above </body> and called the carousel manually so it ends up looking like this
<script type="text/javascript" src="./PRO-Intermediair Your Next Step!_files/bootstrap.min.js"></script>
<script type="text/javascript">
$('.carousel').carousel();
</script>
</body></html>
edit
I posted a copy so you can see http://tctel.com/pro/