|
Javascript storage help..
|
View this Thread in Original format
| UglyDave |
Folks, i think this's the second thread i've started on this topic, but neways, i've got 2 javascript variables that i want to store.
Database / file / anything.
Anyone have ANY ideas on how i can store it?
David |
|
|
| Swamper |
Since javascript is run on the client side there is no easy way to do this.
One way is to simply set up an
document.write('
and within track.php you have stuff set up to take that info and increment the respective mySQL tables or whatever - and then have it return a 1x1 blank gif image to the user (so they don't get a red x from the ![]() |
|
|
| UglyDave |
| quote: | Originally posted by Swamper
Since javascript is run on the client side there is no easy way to do this.
One way is to simply set up an
document.write('
and within track.php you have stuff set up to take that info and increment the respective mySQL tables or whatever - and then have it return a 1x1 blank gif image to the user (so they don't get a red x from the ![]() |
Smamper man, u are so in 1337 it's unbelievable!
that's sheer genius!!
thank u very much!
i'll give ya the url of a working example when it's finished :)
Dave |
|
|
| Swamper |
| I use my geek powers for good ;) |
|
|
| electric_soul |
hmm you should never rely on javascript
javascript is good to speed up checking (ie check some field is not blank or has the proper format) so the user doesn't have to go back and forth error pages.
But you must control that with a server side script anyway.
Besides javascript has it's issues, in this case is something simple but for complicated stuff, not all browser behaive the same way. Also is pretty easy to disable javascript, so you'd end up with no record whatsoever.
my 2 cents |
|
|
| UglyDave |
| quote: | Originally posted by electric_soul
hmm you should never rely on javascript
javascript is good to speed up checking (ie check some field is not blank or has the proper format) so the user doesn't have to go back and forth error pages.
But you must control that with a server side script anyway.
Besides javascript has it's issues, in this case is something simple but for complicated stuff, not all browser behaive the same way. Also is pretty easy to disable javascript, so you'd end up with no record whatsoever.
my 2 cents |
thank u very much also!! |
|
|
| Mr Game+Watch |
| Well, like electric_soul said, Javascript might not be your best solution for the reasons he gave. You'd probably want to use a server-side scripting language, like ColdFusion (which I use at work and will gladly help you with), ASP or PHP (which I am a lot less knowledgable with). All three languages (plus there's more, Perl, Java Server Pages, but these are the 3 most common and easiest to use) allow you to write out variables and have ways to write information to SQL tables, files on the remote server, etc. If you want, you can store the information in an SQL table or even use cookies/session variables to store the data (if the data only applies for one session). Not sure exactly what you need to do with this. |
|
|
| mizzuno |
| quote: | Originally posted by Swamper
I use my geek powers for good ;) |
and tatas...
Mizz |
|
|
|
|