On object click change scene

My script to change level by clicking on a game Object is not working please help!
it has an error:BCE0044: Expecting } found ".
it’s in JavaScript.

SCRIPT:

function Update () {
   if(Input.GetMouseButton(0))
    Application.LoadLevel("NewGame");

Thanks

You forgot a bracket - close Update method.

   function Update () {
        if(Input.GetMouseButton(0))
            Application.LoadLevel("NewGame");
    }

Do not use Application.LoadLevel, it is now depreciated. So I would assume it’s done that way for good reason.

Use SceneManager now.

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement; // <<<<<< ADD THIS.

public class Example : MonoBehaviour {

	// Use this for initialization
	void Start () {
		SceneManager.LoadScene ("NameOfScene");			// <<<< Then Do this.
		SceneManager.LoadScene (0);						// OR THIS (int = scene id in build menu)
	}

EDIT:
And to change a scene by clicking Object, such as UI Button.

public void WhatEver(){
Same code as above with loading scenes, then drag and drop this script onto the button and feed it into the button OnClick at the bottom.
}

What if I wanted to put this on a Cube would it work???