Displaying content with javascript
Posted: Wed Aug 29, 2007 7:12 am
Hey all,
I fairly new to javascript, and I'm trying to build an AJAX/JSON account script (although I have the same problem with other javascript attempts).
Let's say I have 3 pages. A Login, Create and a Welcome screen. When the client is not logged in, the Login screen should come up when the page loads. Otherwise, the welcome screen is shown.
What should I do:
Parse the screen that I need and get other screens behind the scenes (default prototype.js behaviour?) - this is not what I want 'couse I think this can be done much nicer.
Parse all screens on one page and hide the ones I don't need with javascript, and switch between those? This means that users with javascript disabled end up with a messed up screen, and when people view the source they see content they shouldn't.
Generate the screens with javascript. When I would do this, I'd have two versions of the same screen. One in javascript, one parsed by PHP so that the client won't have to wait till the page has loaded.
Or does anyone have a better solution?
Thanks in advance!
I fairly new to javascript, and I'm trying to build an AJAX/JSON account script (although I have the same problem with other javascript attempts).
Let's say I have 3 pages. A Login, Create and a Welcome screen. When the client is not logged in, the Login screen should come up when the page loads. Otherwise, the welcome screen is shown.
What should I do:
Parse the screen that I need and get other screens behind the scenes (default prototype.js behaviour?) - this is not what I want 'couse I think this can be done much nicer.
Parse all screens on one page and hide the ones I don't need with javascript, and switch between those? This means that users with javascript disabled end up with a messed up screen, and when people view the source they see content they shouldn't.
Generate the screens with javascript. When I would do this, I'd have two versions of the same screen. One in javascript, one parsed by PHP so that the client won't have to wait till the page has loaded.
Or does anyone have a better solution?
Thanks in advance!