Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating library of useful little functions
Message
From
20/03/2008 02:20:40
 
General information
Forum:
ASP.NET
Category:
Client-side development
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01303738
Message ID:
01303757
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>I'm wondering if I'm thinking/going in the right direction and what would be the best thing to not re-invent the wheel too much.
>I'm thinking that we can create several useful more or less generic JavaScript f functions and put them in separate js file invoked from the Master page of the webiste.
>Does it sound like a good idea?

Yes.

One js files with stuff that I call on most pages, like the png fix for IE6.
Then other ones separated by what they are used for and that you only include when needed.
(My library is still pretty small but this is how I'm laying it out.)

>I have currently created few little functions such as ShowElement, HideElement, ToggleDisplay, SetValue. I'm thinking of adding CheckIfItemSelected and CheckIfNotEmpty two separate functions one for combo/lists another for textboxes.
>
>Do you think I should create 2 separate functions or better handle it in one function using case switch?

I'd probably create 2 separate functions. But this is kind of up to you I think either way would work just fine. Having them as one would make it easier to remember them, but it would make it harder to separate them into different files.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform