Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

It isnt possible to add arguments to a function that takes no arguments in javascript

Options
  • 25-01-2008 12:30am
    #1
    Closed Accounts Posts: 67 ✭✭


    I saw a funny piece of code on a seemingly professional webdesign website in my town.(Well it really is). I am not going to name it incase any of you are out there on boards.

    Anyway the website uses Macromedias built in javascript functions to play around with the images.

    The function was mm_preLoadImages() ..... No Arguments.

    The company must of thought the javascript magically accepts arguments from a non argumented function such as above.

    They added 5 or 6 arguments.

    You see javascript is one pain in the h**** to decipher problems with. I know so well. It actually dosent give out any errors if you add arguments unlike any other languages I know of C for example.

    If I am wrong please tell me but I really dont think that Javascript can take no existent arguments;

    Another thing I see in many scripts online is this "<!-- //-->" so called hack which was origionally intended for first generation browsers Netscape 1 and mosaic and can actuall can errors as javascript complies the "HTML" comments.


Comments

  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    That's a way of having a non-specific or varied number of arguments.

    If you check the code for that function you will see that it references .arguments

    More info on http://www.devx.com/tips/Tip/13163


  • Closed Accounts Posts: 67 ✭✭BRENSH


    Thanks man. You learn something new everyday


Advertisement