javascript:void(0) on Google Chrome

Started by Vawmataw, April 10, 2015, 10:11:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vawmataw

When you click a button to add a code or a smiley to your message, this little guy does this job. However, I see that on Google Chrome, it stopped working today. I cleared my history and cache, but it doesn't change anything. Everything works well on IE and Firefox. Who has the same issue with Google Chrome?

P.S.: I can't access to the shoutbox on Chrome because of this capricious little guy.
P.P.S.: I hope I don't have to reinstall anything.
Fmawn Ta 'Rrta - News IN NA'VI ONLY (Discord)
Traducteur francophone de Kelutral.org, dict-navi et Reykunyu

Tirea Aean

All works correctly for me on Google Chrome 41 Stable.

I know that when you hover over a button in the quickreply, it always has said this:

javascript:void(0)

which I believe is normal behavior for a button that has a JavaScript onClick attribute.

This is weird. I hope this gets figured out soon. That sounds like it would be so annoying.

Tìtstewan

I am a FireFox user. Everything works normal for me. That javascript:void(0) appears always when hover over the buttons.

As for the shoutbox, I believe that is a weido loading difference between forum and the shoutbox module. I have that many times that the shoutbox didn't completely load, but I just refresh the page and it finally loaded.

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Eana Unil

I use Chrome, both desktop and Android version,  and both work just fine.
Well, lol, my desktop version has some issues, but the one you mentioned is none of them.
???

Vawmataw

Fmawn Ta 'Rrta - News IN NA'VI ONLY (Discord)
Traducteur francophone de Kelutral.org, dict-navi et Reykunyu

Tìtstewan

I am now on Google Chrome, and it works for me. I also used that theme you have enable (according that screenshot).

Does ctrl+F5 works (not simple F5)?

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Tirea Aean

Quote from: Vawmataw on April 11, 2015, 06:40:57 AM
old gallery link?id=6347[/img]

That's weird.

Try to right-click on the page (maybe even around where the shoutbox should be) and Inspect element to and then refresh the page and then paste any console errors here. Together, we can  discover the cause of this. :)

Vawmataw

Of course (I had to upload them with IE).
Fmawn Ta 'Rrta - News IN NA'VI ONLY (Discord)
Traducteur francophone de Kelutral.org, dict-navi et Reykunyu

Tirea Aean

But.. but but... I found those functions in the source code for ALL themes! :O

You use LearnNavi2, right? Here's what I found:

Quote from: index.php[...]
<script language="JavaScript" type="text/rocketscript" data-rocketsrc="http://forum.learnnavi.org/Themes/default/script.js?fin11" data-rocketoptimized="true"></script>
[...]

which for you will probably say:

Quote from: index.php[...]
<script language="JavaScript" type="text/rocketscript" data-rocketsrc="http://forum.learnnavi.org/Themes/LearnNavi2/script.js?fin11" data-rocketoptimized="true"></script>
[...]

But it doesn't matter because I copied all the JavaScript functions that the default theme uses, to all themes.

Quote from: script.js?fin11
[...]
function storeCaret(text) {
    if(typeof(text.createTextRange)!="undefined")
        text.caretPos=document.selection.createRange().duplicate();
}

function replaceText(text,textarea) {
    if(typeof(textarea.caretPos)!="undefined"&&textarea.createTextRange){
        var caretPos=textarea.caretPos;
        caretPos.text=caretPos.text.charAt(caretPos.text.length- 1)==' '?text ' ':text;
        caretPos.select();
    } else if(typeof(textarea.selectionStart)!="undefined") {
        var begin=textarea.value.substr(0,textarea.selectionStart);
        var end=textarea.value.substr(textarea.selectionEnd);
        var scrollPos=textarea.scrollTop;
        textarea.value=begin  text  end;
        if(textarea.setSelectionRange) {
            textarea.focus();
            textarea.setSelectionRange(begin.length  text.length,begin.length  text.length);
        }
        textarea.scrollTop=scrollPos;
    } else {
        textarea.value =text;
        textarea.focus(textarea.value.length- 1);
    }
}

function surroundText(text1, text2, textarea) {
    if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange) {
        var caretPos = textarea.caretPos,
            temp_length = caretPos.text.length;
        caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text1   caretPos.text   text2   ' ' : text1   caretPos.text   text2;
        if (temp_length == 0) {
            caretPos.moveStart("character", -text2.length);
            caretPos.moveEnd("character", -text2.length);
            caretPos.select();
        } else
            textarea.focus(caretPos);
    } else if (typeof(textarea.selectionStart) != "undefined") {
        var begin = textarea.value.substr(0, textarea.selectionStart);
        var selection = textarea.value.substr(textarea.selectionStart, textarea.selectionEnd - textarea.selectionStart);
        var end = textarea.value.substr(textarea.selectionEnd);
        var newCursorPos = textarea.selectionStart;
        var scrollPos = textarea.scrollTop;
        textarea.value = begin   text1   selection   text2   end;
        if (textarea.setSelectionRange) {
            if (selection.length == 0)
                textarea.setSelectionRange(newCursorPos   text1.length, newCursorPos   text1.length);
            else
                textarea.setSelectionRange(newCursorPos, newCursorPos   text1.length   selection.length   text2.length);
            textarea.focus();
        }
        textarea.scrollTop = scrollPos;
    } else {
        textarea.value  = text1   text2;
        textarea.focus(textarea.value.length - 1);
    }
}

[...]

function setOuterHTML(element, toValue) {
    if (typeof(element.outerHTML) != 'undefined')
        element.outerHTML = toValue;
    else {
        var range = document.createRange();
        range.setStartBefore(element);
        element.parentNode.replaceChild(range.createContextualFragment(toValue), element);
    }
}

[...]


Tìtstewan

What if he didn't get the complete script from the local cloudflare server? :-\

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Tìtstewan

#10
I can't use the buttons on the QuickReply and in the normal editor. What happend? And the shoutbox isn't visible for me (same like Vawmataw).
I use FireFox 37.0.1
Tested on google chrome: doesn't work

Error codes:
ReferenceError: error is not defined                       rocket.js:4:15637
ReferenceError: tooltip is not defined                   6  javascript(void)0-on-google-chrome:1:0
ReferenceError: storeCaret is not defined              40  javascript(void)0-on-google-chrome:1:0
ReferenceError: surroundText is not defined            javascript(void)0-on-google-chrome:1:0
ReferenceError: storeCaret is not defined             100  javascript(void)0-on-google-chrome:1:0
ReferenceError: submitThisOnce is not defined            javascript(void)0-on-google-chrome:1:0
ReferenceError: submitonce is not defined                  javascript(void)0-on-google-chrome:1:0
etc.

Google Chrome error messages:
Uncaught ReferenceError: error is not defined
(index):283 Uncaught ReferenceError: tooltip is not defined
(index):283 Uncaught ReferenceError: tooltip is not defined
(index):1367 Uncaught ReferenceError: storeCaret is not defined
(index):1363 Uncaught ReferenceError: replaceText is not defined
2(index):1364 Uncaught ReferenceError: replaceText is not defined
(index):1365 Uncaught ReferenceError: replaceText is not defined
(index):1351 Uncaught ReferenceError: replaceText is not defined
...etc

on IE11

Works, only one error appears there: createRange in
{if(typeof(text.createTextRange!="undefined")
text.caretPos=document.selection.createRange().duplicate();}

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Wllìm

I have no problems here with both Firefox on Android and Chrome on Android...  :-\

Tìtstewan

I see. The android version of firefox works but not the desktop one...  :-\

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

uniltiranyu aean

kaltxì ma smuk
I NEED HELP,please.
I hope you can see the screenies (its only one picture but i didn't know which link i should use :D)
i can't open the "+" to see the "[...]new replies" and ²new unread posts] and the shoutbox don't show itselfs.
I try to reload the page a million times, i log me out and in very often and i don't know what i should do :'(
(the smilies, when i click on them, they don't come right to the message...but they move, and the other options don't function either)

little thing may be it isn't important, when im with the mouse on the "-" of the shoutbox, at the left corner on the bottom, there stands: javascript:void(0)

do you know what to do?

Ah may be important information too, Im using Mozilla Firefox
You can write me in Italian, French, German and of course in English.

Eywa ngahu

Tìtstewan

Ma uniltiranyu aean,
Here is the right place for it. ;)

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Wllìm

#15
Quote from: Tìtstewan on April 12, 2015, 03:45:07 AM
I see. The android version of firefox works but not the desktop one...  :-

Indeed. I am now on my laptop and can confirm that both Firefox and Chromium are broken. This is really strange. ???

* Wllìm opens the inspector and starts debugging

Edit: it seems like a required JavaScript file is missing completely...

Edit 2: also [desc] tags are broken, since they require some function tooltip, but that is missing as well. >:(

Edit 3: right, the file http://forum.learnnavi.org/Themes/default/script.js?fin11 is not being loaded. Now the question is why...

Edit 4: the HTML source says

<script language="JavaScript" type="text/rocketscript" data-rocketsrc="http://forum.learnnavi.org/Themes/default/script.js?fin11"></script>

but that is not a valid way to load the script. It should say something like

<script type="text/javascript" src="http://forum.learnnavi.org/Themes/default/script.js?fin11"></script>

This RocketScript thing seems to be CloudFlare-related...

Toliman

Also I can't see shoutbox on google chrome and buttons in normal editor now. On IE (and android) is all right.  :-\

Tìtstewan

Quote from: Wllìm on April 12, 2015, 04:00:05 AM
Edit 2: also [desc] tags are broken, since they require some function tooltip, but that is missing as well. >:(
For me, all buttons doesn't work that requres a script.

In the gallery I get directly to the editor windows instead a message box, and when I quote something, I get navigated to the full editor windows instead the quickreply.
Also quick edit doesn't work.

EDIT:
Quote from: Wllìm on April 12, 2015, 04:00:05 AM
Edit 3: right, the file http://forum.learnnavi.org/Themes/default/script.js?fin11 is not being loaded. Now the question is why...
But it loades for the internet explorer...

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Tìtstewan

#18
It seems that no script works on this forum. In the /Spam, Neytiri doesn't rotate anymore.


EDIT:
Ma Wllìm,

I see what you are seeing:

<script language="JavaScript" type="text/rocketscript" data-rocketsrc="http://forum.learnnavi.org/Themes/default/script.js?fin11"></script>
<script language="JavaScript" type="text/rocketscript" data-rocketsrc="http://s.learnnavi.org/js/jquery-1.10.2.min.js"></script>
<script type="text/rocketscript" data-rocketsrc="http://s.learnnavi.org/js/jquery-css-transform.js"></script>
<script type="text/rocketscript" data-rocketsrc="http://s.learnnavi.org/js/jquery-animate-css-rotate-scale.js"></script>
<script language="JavaScript" type="text/rocketscript" data-rocketsrc="http://s.learnnavi.org/js/inline-audio.js"></script>

There is data-rocketscript= !Summon Markì !Summon Tirea, srung sivi ayoer.

-| Na'vi Vocab + Audio | Na'viteri as one HTML file | FAQ | Useful Links for Beginners |-
-| Kem si fu kem rä'ä si, ke lu tìfmi. |-

Wllìm

Right, my hypothesis is the following: the server-side uses those RocketScript tags with the intention that they are replaced by CloudFlare by normal script tags as part of their RocketScript technology, but CloudFlare doesn't do that for some reason. Hence the browser gets invalid script tags, and thus doesn't load any JavaScript on the forum.

I'm not sure why the tags do work with the mobile browsers and IE, though... ???