JS errors breaking: quick reply, mentions and being thrown every mouse click

Started by becometa, February 25, 2018, 03:04:40 PM

Previous topic - Next topic

becometa

Howdy,

it seems that this week on my side is completely filled with fails that i'm facing everyday...
Nevertheless, after digging through my forums i've noticed that browser console is actually full of red because of errors.
Patient: http://kryptowaluty.org.pl


  • quick reply is working partially - reply is being saved after pushing the post button but in order to see it normal page refresh is needed.
    Effect caught "on tape": https://drive.google.com/file/d/1ocmAmj5k3N2C1YGxsC-6l-lx4opmvSHZ/view
    Quotetopic.js:236 Uncaught TypeError: XMLDoc.getElementsByTagName is not a function
        at QuickReply.onPostDone (topic.js:236)
        at XMLHttpRequest.oSendDoc.onreadystatechange (script.js?fin20:123)
  • user mentions dialog is not showing up
    QuoteUncaught TypeError: Cannot read property 'fn' of undefined
        at HTMLScriptElement.load_mentions (mentions.js:79)
  • every mouse click on page is generating 3 consisent errors
    Quoteapp.js?fin20:322 Uncaught TypeError: $ is not a function
        at HTMLDivElement.<anonymous> (app.js?fin20:322)
        at HTMLDivElement.dispatch (jquery.min.js?fin20:3)
        at HTMLDivElement.r.handle (jquery.min.js?fin20:3)

To make things even weirder I haven't actually touched any of the mentioned scripts as I'm not that much into JS, lol. I really don't have an idea when first occurance of mentioned errors might happen.

From what I've checked:

  • problems are not browser specific
  • on siteload jQuery is being loaded before bootstrap and other scripts - as needed and required by jQuery devs
  • there should be no conflict between mods and snippets i've applied (none reported) - however there are lots of them applied..
  • from stackoverflow reply, some dev stated that it's not preferred when one script calls jQuery function from $ and the other from jQuery()
  • we can ignore unsecure webpage information - it's a web hosting company problem with SSL issuing date that they're going to fix (i hope, lol). I've copied my forum instance to localhost and problems mentioned above still exist no matter SSL/normal protocol

I can setup a test user with right privileges if needed.

I'm going to throw a beer right at the table for help!  ::)

Kindred

Well, what did you change recently?

Since mentions are not a standard part of smf, I'd bet that you installed that mod... or another one tha does JavaScript and it screwed up your js in places.

What mods do you have installed?
What smf version?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

becometa

Last changes to the code was done by me almost a month ago so... i'm not able to recall what it was actually...  :-X
Forum version: 2.0.15

I'm using custom theme and because of that I'm not being able to list every mod i've installed on forums manually. Unfortunately... Counter of those installed (at least partially) automatically stops at 105, so...

Kindred

Well, the error is almost definitely caused by a mod...   and with that many, it's a toss up as to which one.  However, if you manually installed mods, then I think you have indicated how the error happened...     

But we really can't narrow it down all that much with what you've given us.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chen Zhen


I can see a js error on the page from your custom theme.

Look for the js file named app.js and near the beginning of the file it has:

jQuery.noConflict(); OR  $.noConflict();


.. edit the file and pick one way to call the same function OR the other (not both with the word OR smack in the center) or possibly omit the entire line.
ie. attempt to change it to:

jQuery.noConflict();


.. also your webtiryaki mobile theme is custom and you may be able to get help from their support site since I assume you paid for it.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

becometa

Quote from: Kindred on February 25, 2018, 06:33:05 PM
Well, the error is almost definitely caused by a mod...   and with that many, it's a toss up as to which one.  However, if you manually installed mods, then I think you have indicated how the error happened...     

But we really can't narrow it down all that much with what you've given us.

Sure, i completely understand your concerns. Just thought that it might be worth to try to post as someone with JS knowledge might notice the errors and be able to fix them.


Chen Zhen, i've changed the line which you've directed me to but still no success on fixing any of the mentioned faults. Leaving the jQuery.noConflict(); throws another error in console so i've decided to remove it as well.
Theme is free and available for download here. As it's free i'm not imposing theme author to provide any kind of support. I will however try to grab theme author attention ;D

Kindred

thing is, you actually have to ask the theme author for support.

We don't support custom themes -- theme support is the responsibility of the author and should be followed up in the support thread dedicated to supporting that specific theme. (https://www.simplemachines.org/community/index.php?topic=543941.0)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: