Error with function OnTriggerXXX

Hello dear Unities!

I've been tryin to get myself into the scripting of Unity and finished several av online tutorials and is now trying to implement things myself to extend my understanding even further. Unfortunately I've run into a problem I can't understand the slightest and I'm moments from ripping my pants to shreds and throwing the comp into the oven.

As the title implies the problem has to do with collision, in this case between the character and the ground. Both has a isTrigger box checked and one of them is a rigidbody. The code is as follows:

var yForce = -9.82;
var xForce = 0.0;
var zForce = 0.0;

var onGround = 0;
var gravity = -9.82;

function Update () {

    if (onGround==0){
        yForce+=gravity*Time.deltaTime;
    }

    if (Input.GetButtonDown("Jump") && onGround==1){

        yForce += 20;
        onGround = 0;

    }
    ///*
    function OnTriggerEnter(other : Collider) {
        if (other.gameObject.tag == "Ground"){
        onGround = 1;
        }
    }
    //*/
    if (onGround == 0){
        transform.localPosition.y += yForce*Time.deltaTime;
    }

}//End Clam

The problem generates an error message and turns the game unplayable:

Assets/ Nya Script tester/ Nyare scripts (handmade)/Jumping.js(33,18): BCE0044: expecting (, found 'OnTriggerEnter'.

I have tried doing the same thing using all different types of OnTrigger and tried using OnCollisionEnter instead with no positive results. It all seems to point at the "function" part somehow and i have no idea of how to fix this since all collision detections i know of uses a function call.

I would be infinitely gratefull for any kind of help!

Thanks!

You've put the OnTriggerEnter function inside of the Update function, which is a syntax error. Move it down after where you have the //End Clam comment and it should work