XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Why does the method take input and response?
Date: 2005-05-17 11:58:36
From: tieTYT

I still don't understand why this function:
function checkName(input, response)
needed to take an input and a response.


Why couldn't it be broken up into 2 functions?


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Why does the method take input and response?
    2005-05-17 12:20:44 drewmclellan [Reply]

    You're right. It could be two functions. Making it one was simply a design choice. If you were to have lots of different actions on a page resulting in an xmlhttprequest call, it can be a lot tidier just to have a single function to handle each action.


    If using two functions works better for you, there's no reason not to do it that way.

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938