Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Javascript error code problem

  1. #1
    Junior Member
    Join Date
    Mar 2020
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript error code problem

    I keep getting the error code “use script” not defined.

    I know this needs adding but I don’t know where to put it. Can anyone help please? The problem is with the IF statement. I am new to Java and know this is to do with the new version but I don’t know what to do. Please help!

    var playing = false;
    var score;

    //if we click on the start/reset
    document.getElementById("startreset").onclick = function(){
    //if we are playing
    if(playing == true){
    location.reload(); //reload page
    }else{//if we are not playing
    //change mode to playing
    playing = true;
    //set score to 0
    score = 0;

    document.getElementById("scorevalue").innerHTML = score;

    //show countdown box

    document.getElementById("timeremaining").style.dis play = "block";

    //change button to reset

    document.getElementById("startreset").innerHTML = "Reset Game";
    }
    }

  2. #2
    Junior Member
    Join Date
    Mar 2020
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Javascript error code problem

    Ok I fixed this one now myself thank you
    Last edited by Charlray; March 3rd, 2020 at 03:43 PM.

Similar Threads

  1. Replies: 3
    Last Post: May 8th, 2014, 06:25 AM
  2. import netscape.javascript.JSObject - Error
    By ilans11il in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 21st, 2013, 03:41 AM
  3. Help needed - Embedding javascript code in JSP code.
    By chinnu in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: October 29th, 2012, 01:09 PM
  4. JavaScript Error in Task Bar..!!
    By ashishrajiit in forum Other Programming Languages
    Replies: 2
    Last Post: November 13th, 2011, 10:50 AM
  5. Javascript error in a lightbox gallery...
    By tigerbuilder81 in forum Other Programming Languages
    Replies: 3
    Last Post: November 4th, 2011, 07:52 AM