Hi all,

My local development project has been working perfectly for...6 days now? I haven't even touched the login/register page for 2 days+ yet all of a sudden all JavaScript has seized up! I've been using the page to login all day and only now has it stopped working.

I'm using JQuery to manage what form is present based on button clicks and this has been working perfectly. here is one example:

jQuery('#register-btn').click(function () {
    jQuery('.login-form').hide();
    jQuery('.register-form').show();
});

The button that calls this JQuery:

<div class="create-account">
    <p>
        Don't have an account yet ?&nbsp; 
        <a href="javascript:;" id="register-btn" class="">Create an account</a>
    </p>
</div>

Now when that button is lciked nothing happens. Again, the problem is now with any of the code above as all JavaScript has stopped working. This includes the fading background:

$.backstretch([
    "assets/img/bg/1.jpg",
    "assets/img/bg/2.jpg",
    "assets/img/bg/3.jpg",
    "assets/img/bg/4.jpg"
    ], {
      fade: 2000,
      duration: 4000
  });

I'm working on Windows 8 and using XAMPP. I have tested this in all 4 of my installed browsers (Chrome, Firefox, Safari & Opera). What can cause JavaScript to just stop working? I have attempted a machine restart as well as an apache2 restart. Google searches don't seem to be getting me anywhere.

Thanks in advance for any help.

Recommended Answers

All 8 Replies

I should say that the page loads, but when I click anything to do with JS it just doesnt respond.

Member Avatar for iamthwee

Things just don't stop working... Either you've accidentally changed a part of the code somewhere (most likely) or worse case a virus other software is interfering.

Things to try
Are you linking the jquery libraries from online google libs?

http://stackoverflow.com/questions/2166689/jquery-script-not-working-when-page-viewed-on-localhost

Could be a file permission also.
Are you linking the jquery files properly?
Have you added the jquery files in the right order. Usually the main jquery libs need to go before the others?

http://stackoverflow.com/questions/13030262/jsfiddle-jquery-working-not-working-on-localhost

No everything is coming locally - and I'm in the same thought process as you - things don't just stop working! I know it's not my code or something I've changed as I opened the source template that I purchased a week back and added it to a new local directory. That didn't work either. I'm going to disable a load of programs and retest.

I'm just uploading the project to my webserver for the first time to test it. If it works I know it's something at the core (In xampp) or something blocking it on my PC. If it doesnt work I'll try another PC incase its a local browser/PC issue. If neither work then I'm stuffed.

I've uploaded to a webserver - it didn't work.

I've tried another PC - it didnt work.

It has to be the code. It makes no sense because I haven't touched the original files (they're still zipped)... I extracted them and they didnt work either...

OMG I figured it :3 My business partner opened the file whilst I was tucking into dinner and changed login.js but he left an error! He called me to tell me he'd changed a few things so I went through the script character by character and found a mising comma! What a bugger! The reason the .zip didn't work was my fault... I was working from a zip he'd taken and not the original files. he's literally ruined my night.

Talk about aone man topic!

This is me signing out :)

Member Avatar for iamthwee

Oh yeah, I've been there... but using what I thought where the orig files... But were acutally my ammended and messed up files.

In short if something goes wrong it's most likely to be user error! Glad you sorted it though.

Yeah couldn't agree more bud - thanks for looking into it though!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.