Solved: 7 Years ago [JavaScript] Why does Mybb automatically alter javascript ?
#1
Solved: 7 Years ago
Im using tawk.to on my website's home page (https://hovatek.com/) , Wordpress powered blog (https://blog.hovatek.com/) and mybb powered forum ( https://forum.hovatek.com/ ) . The srcipt works fine on the home page and blog but doesnt work on the forum

here's the original below
<script type="text/javascript">
var $_Tawk_API={},$_Tawk_LoadStart=new Date();

but mybb converts it to

<script type="text/javascript">
var ={},=new Date();

what is the cause and how can it be resolved?
Hovatek Forum | Hovatek Blog |

Hovatek....just a button away!
Reply
#2
Solved: 7 Years ago
Well, the magic of eval().. PHP thinks that your JS variable is in fact an empty PHP variable and prints it.
Reply
#3
Solved: 7 Years ago
(2014-12-01, 10:46 PM)Destroy666 Wrote: Well, the magic of eval().. PHP thinks that your JS variable is in fact an empty PHP variable and prints it.

Yeah, php is seeing those $ as variables. will escaping them work?
Hovatek Forum | Hovatek Blog |

Hovatek....just a button away!
Reply
#4
Solved: 7 Years ago
Don't think there is an easy way to escape it in templates, you should rather put the JS code in a file and then load the file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)