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 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Javascript functions suddenly stopped functioning across the whole website

    Hi,
    I am stuck with a weird situation.

    I have changed nothing. Not on my file neither updated my browser etc.
    But all javascript functions that were functioning properly till yesterday arent working now.

    For example, I have created a test page on the website with simple 1 line javascript function here. Its dead.
    http://shareyt.com/testingjava.php

    To tell more specifically, java script stopped executing ajax commands.
    and also codes like this dont work
    Code:
     $("#id").html('say something');
    I have talked with my host (bluehost) and they found nothing on server side.
    Its turning out to be a tumor in the head now.
    Can anyone give a fix to this?

    ( this is a ptc website almost like traffic exchange, where the site heavily relies on javascript functions. Can it be some hackers trying to sabotage?)

    Best Regards.
    Last edited by sanomani; 04-20-2013 at 08:19 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,918
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Try setting up a test using vanilla Javascript, not jQuery.

    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New Coder
    Join Date
    Jun 2012
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Now, it worked again, without changing anything anywhere. At times system works and at times it doesnt. I am running this exchange site for more than 1 year and never experienced such stuffs.

    Trying vanilla.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,184
    Thanks
    75
    Thanked 4,340 Times in 4,306 Posts
    That code on that page you linked to, http://shareyt.com/testingjava.php, will *NEVER* WORK as coded.

    You are trying to use jQuery syntax but you DID NOT LOAD the jQuery library!

    This has NOTHING to do with any server. You can't use jQuery if you don't have a line that includes it in the web page.
    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.


  •  

    Posting Permissions

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