Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    "Error: Please enable Javascript" - but it IS enabled!!

    Hi,

    a friend of mine has a problem on several (German) Legend of the Green Dragon (lotgd) servers.

    Sometimes, mostly after she has loged in and out for a few times during a day, she suddenly gets the message that Javascript must be enabled to log in. But it definetely IS enabled - otherwise she'd never be loged in!

    The error occurs
    - on 2 different PCs
    - with 2 different internet providers
    - with IE, FF and Opera
    - only on lotgd servers - any other page using Javescript are working fine

    We
    - updated and downgraded Javascript
    - disabled and/or uninstalled all antivirus and firewall programms
    - cleaned cache with CCleaner
    - disabled browser add ons
    - reinstalled Windows
    - disabled auto-insert passwords

    Even a reboot doesn't change anything. Sometimes, when she waits a few hours, she can log in again. Sometimes the error doesn't occur for days, sometimes it's there every day.
    That's why it is so strange. Although she doesn't change anything, the error comes and goes completely irregular.

    The games' admins can't or don't want to help, they say that she's the only one with that problem and that it's not a mistake in the script.

    What might occur that error? And what can we do to stop it??

    That's what the Opera error console says:

    JavaScript - http://lotgd.demonstone.org/index.php
    Inline script compilation
    Syntax error at line 21 while loading:
    b|(~d)),a,b,x,s,t);}*/
    --------------------^
    expected expression, got '*'
    CSS - http://lotgd.demonstone.org/templates/yarbrough.css
    Linked-in stylesheet
    xbackground-color is an unknown property
    Line 1:
    eight:auto;padding:1px;line-height:18px;float:left;clear:none;xbackground-color:
    --------------------------------------------------------------------------------^
    JavaScript - http://lotgd.demonstone.org/index.php
    Inline script compilation
    Syntax error at line 21 while loading:
    b|(~d)),a,b,x,s,t);}*/
    --------------------^
    expected expression, got '*'
    JavaScript - http://lotgd.demonstone.org/index.php

    Uncaught exception: ReferenceError: Undefined variable: calcMD5
    Error thrown at line 1, column 0 in <anonymous function>(event):
    document.forms.loginform .hidden_pw.value = calcMD5(document.forms.loginform .password.value);
    JavaScript - http://lotgd.demonstone.org/index.php
    Inline script compilation
    Syntax error at line 21 while loading:
    b|(~d)),a,b,x,s,t);}*/
    --------------------^
    expected expression, got '*'
    JavaScript - http://lotgd.demonstone.org/index.php

    Uncaught exception: ReferenceError: Undefined variable: calcMD5
    Error thrown at line 1, column 0 in <anonymous function>(event):
    document.forms.loginform .hidden_pw.value = calcMD5(document.forms.loginform .password.value);
    JavaScript - http://lotgd.demonstone.org/index.php
    Inline script compilation
    Syntax error at line 21 while loading:
    b|(~d)),a,b,x,s,t);}*/
    --------------------^
    expected expression, got '*'
    JavaScript - http://lotgd.demonstone.org/index.php

    Uncaught exception: ReferenceError: Undefined variable: calcMD5
    Error thrown at line 1, column 0 in <anonymous function>(event):
    document.forms.loginform .hidden_pw.value = calcMD5(document.forms.loginform .password.value);
    JavaScript - http://lotgd.demonstone.org/index.php
    Inline script compilation
    Syntax error at line 21 while loading:
    b|(~d)),a,b,x,s,t);}*/
    --------------------^
    expected expression, got '*'


    I hope someone is able to help. Thank you!
    Last edited by Naru; 07-21-2010 at 09:11 PM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Don't think we can help. The owners of those servers will have to fix their clearly buggy JavaScript code.

    Though looking at that index.php page using Firefox and FireBug, I can't see any of those errors.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Why are they bothering to hash the password on the client side? This seems to be the problem, because if I (...still have javascript disabled and...) use firebug to change hidden_pw to type of "text" and manually enter even a single character, leave the password field blank, and enter text in the "name" field - then click on submit - I don't get any "javascript must be enabled" message. I just get a message that my login details were incorrect. For the javascript message the server is only checking to see that there IS a value for "name" and that there ISN'T a value for "password." If any value is entered for "name" then "password" must be blank or the message about javascript is displayed. The "hidden_pw" field can be blank or loaded with text and either way it won't affect the javascript message.

    As for why this is failing... At some point the script is failing to wipe out the value of "password." It may or may not also fail to assign a value to "hidden_pw" (which would make the login fail but would not display the javascript warning - without having a valid login to test with I wouldn't know).

    Why is it doing that? I have no clue. The page logs keystroke events (for a login shortcut key or something? I haven't reviewed it that closely) but firefox throws a warning for each key press. Maybe all of that is causing a problem. Or maybe the google api scripts are conflicting. Something is apparently "crashing" the javascript, which prevents the login md5 hash from running and clearing out the regular password field, which gets you an error message in the page.

    Fixing this would be a waste of time in my opinion. Client-side validation of input format is OK. But if I were you, I would recommend that my friend switch all of his credential manipulation activities to the server side and then you won't have this problem. Whatever purpose this login gymnastics serves should be solved elsewhere. There is nothing about this script that couldn't be handled on the server side without any fuss at all.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •