View Single Post
Old 12-04-2008, 02:24 AM   #4 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Yep, that's the one! And also reverse the function and function names, as seen below. Hopefully this should get it working, but don't hesitate to re-paste the new code if it still doesn't work.

javascript Code:
/* Don't forget the equals symbol. */
var TalkPHP =
{
    /* This is the RIGHT way. */
    MyFunction1: function()
    {
        alert('My Function 1');
    },
    /* Don't forget a comma at the end of
    a function, before you start another. */


    /* This is the WRONG way. */
    /* Don't forget the colon after "function" */
    function: MyFunction2()
    {
        alert('My Function 2');
    }
    /* No need for a comma here unless you're
    adding another function below it. */

}

Remember: functionName: function()
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote