If you feel like you can't contribute yourself, but have a good question, post it here so that I or some other member on these forums can write it if they feel like they can do it well. If you have any input on the questions already answered in it, post that input here.
Code snippets should be wrapped in [code][/code] blocks.
Comments within code blocks should be wrapped in [color=green][/color].
Script snippets in running text should be wrapped in [color=blue][/color].
If you write an example of an error, the code causing the error should be wrapped in [color=red][/color].
Use [i][/i] to wrap text that the user should replace by own code.
In running text, use [b][/b] to wrap JavaScript objects.
Please don't include your signature if it isn't relevant to the question, and make sure that no part of any script snippets included in the post are replaced by smilies.
This thread might be a good place to develop things to be added to that thread.
Q: What is Javascript good for?
A: Because any general web user may have javascript in their browser disabled any use of javascript on a web page is best limited to enhancing the functionality, user friendliness and overall experience on your web pages. Nothing on your page should absolutely depend on javascript unless it's a non-essential part of the page. Javascript can also be used to make a page less friendly but there's no point in doing that.
Useful things: Forms Validation, because Javascript can be disabled you must always perform validation on the server side but any validation of user input you can also perform interactively with the user before a form is submitted can save the user a round trip to the server and can save your server a hit where no actual transaction occurs. Interactive Forms, In the case of something like an online store it's always nice to update order totals and (when possible) shipping costs and other incidental costs (handling fees, taxes...) as the user updates the quantities or selects/deselects various items on the page. While you may want to post that toal back to your server for your own security, you must never trust that figure. Recalculate any totals based on the posted selections/quantities, you can however compare the posted total vs the server side computed total to detect bugs in the script and/or attempts at theft. Visual aides, the Title property can and should be used to give a user of your web page additional information about some element or group of elements on your page but javascript can be used to supplement the relatively weak content control available via the title property with a much richer full html content using a tooltip script.
>>>-------------- This is something that could potentially go into the FAQ but I suspect it could also do with some additional development.
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
Last edited by Roy Sinclair; 03-01-2004 at 08:55 PM..
its been said 1 million times not to address threads to individual people.
scroots
__________________
Spammers next time you spam me consider the implications:
(1) that you will be persuaded by me(in a legitimate mannor)
(2)It is worthless to you, when i have finished
Originally posted by scroots its been said 1 million times not to address threads to individual people.
scroots
You either left off the smiley that said you're kidding or you missed the concept that [ANN] is short for Annoucement and is not directed to a user named Ann.
(Edit: LOL, I see you added the missing Smiley )
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
Last edited by Roy Sinclair; 03-01-2004 at 10:27 PM..
Well, I just got reminded on ICQ that according usenet guidelines, it seems I should have used [ANNC] instead of [Ann] (According to them, case is important). Oh well...
Excellent idea David. This is definitely a good addition to the JavaScript forum.
Here's my attempt at answering those two suggested FAQs...
Q: How do I read/write files? A: Pure client-side JavaScript cannot write files to the server because it simply was never intended to and moreover, that's what server-side languages are used for. Perhaps there are security reasons among others for this as well.
As for reading files with JavaScript, this is completely possible and done quite easily if you use something like Vlad's script or David's script.
Q: How do I get multiple scripts to work on a single page? A: The short (not recommend) answer is to rename all of the variable and function names in the second instance of the script thus preventing them from conflicting.
The longer (recommend) answer would be to rewrite the script in an object-oriented fashion. The reason you'd do it like this is because this is inherently how object-oriented code is intended to work: with multiple instances. This is true because when you call the constructor for that object, all variables become internal properties of it therefore completely removing the chance of anything conflicting between the two scripts. Also note by making it an object you can have as many instances of it on a page as you'd like — it's not only limited to two.
For more information on this, check the following threads:
Any suggestions on how to make them more accurate or otherwise better would be much appreciated.
Though, wouldn't it be great if you could use definition lists on the forums? That would be the best way to lay out this kind of information. Maybe we could get George to modify the vB code or something...