Archived topic
Javascript Calc works when logged in, but doesn't work when logged out.
9 replies · Started by Web Parade Ltd on October 1, 2018
Hi,
I have installed a Javascript Calculator, when I am logged in it works fine. It is from the current site. I have installed on the development site.
What could explain why it works logged in and doesn't logged out.
Any suggestions would be gratefully accepted.
Hi there,
I am seeing this error in the console:
Refused to execute https://raw.githubusercontent.com/jquery/jquery-ui/master/external/jquery-1.11.3/jquery.js as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type.
Hi David,
Thanks for answering.
I saw that as well. I can take that line out it makes no difference. And in the original site, it has the same warning and the calculator works fine.
Similarly when logged in, I get that warning, calc works fine.
T
WordPress already adds jQuery to the page if needed, so you should be able to remove this line of code:
<script type="text/javascript" src="https://raw.githubusercontent.com/jquery/jquery-ui/master/external/jquery-1.11.3/jquery.js"></script>
Let me know :)
Hi Tom,
Sorry for the late reply, and thank you for yours. I had the calculator working. However I then uninstalled and reinstalled both GP and GP Premium due to other conflicts with Elementor, unable to edit templates. That fixed those.
However I find myself back here again with the same issue.
I have followed your instruction and removed that line of code, i am now seeing this error when trying to operate the calc -
JQMIGRATE: Migrate is installed, version 1.4.1
/wp-content/plugins/pdf-embedder/js/pdfjs/pdf.worker.min.js:1 Warning: TT: undefined function: 32
/wp-content/plugins/pdf-embedder/js/pdfjs/pdf.worker.min.js:1 Warning: TT: undefined function: 32
(index):384 Uncaught TypeError: Cannot read property 'style' of undefined
at submitFunction ((index):384)
at HTMLInputElement.onclick ((index):718)
Any suggestions?
Does it go away if you deactivate the pdf-embedder plugin?
Hi,
No. It simply doesn't fire at all since I reinstalled. Although the above fix regarding the jquery line of code seems to be fine.
It looks like that file I mentioned above has been re-added?: https://www.screencast.com/t/HOl2IGJ6e
Can you try removing it again?
Hi Tom,
I removed it in the Elements, set element to apply only on relevant page. Deactivated plugins I was using previously. And (fingers crossed) it seems to be working without issue.
Thanks for all the help and advice.
Love your work.
Glad I could help :)