To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
i'm just about ready to start my first javascript project, but there's one thing i need to know before i do it.
is it possible to make and if/else statement where if the else part is the active part that the javascript will exit and go into regular html mode so that in the 20% or so chance cae that the user has js disabled, they'll still be able to see the site? and if so, if the if part is the active part, will it do that and then the regular html part or just the if part?
I'm really trying to understand what you're saying... honestly... but I can't.
You mentioned "if the user has JS disabled". If they have it disabled, the entire script won't do a single thing. Instead, you might look at using NOSCRIPT tags.
__________________
***If your problem has been solved, PLEASE click the RESOLVED LINK under "Thread Tools"***
"Well Bones, do the new medical facilities meet with your approval?" -- Kirk
"They do not. It's like working in a damn computer center" -- McCoy (Star Trek: TMP)
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,128
bradgrafelman has already given you your answer.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
The way one deals with this is, you create a regular HTML version of the site that includes a javascript redirect to the javascript version. If they have it disabled, they see the HTML version since the redirect will do nothing. And obviously if they have it enabled they'll be redirected to the JS version
__________________
PHP builder Online Community Manager
Bit cumbersome if he wants to code an entire JS free version of the site though. Means longer load time for everyone, if the page is complex and has a fair amount of code.
__________________
PHP builder Online Community Manager
Bit cumbersome if he wants to code an entire JS free version of the site though. Means longer load time for everyone, if the page is complex and has a fair amount of code.
Seeing as though he's been extremely vague on what he wants to do, I thought I'd put it out there.
ok, here's is what i'm trying to do, i'm trying to make it so that if your screen res is smaller than 1024x768, a lower res version will be displyed AUTOMATICALLY
no here's the thing, i can make it so that if the user has javascript disabled, they will just get the regular, pure html 1024x768 version. that's the easy part. the problem is, i don't know if it's possible so that if js is enabled, they will only get the version that corresponds with their screen res instead of both tables
Using the method I mentioned, you can. Put the screen width detect script with a redirect into the 1024 version. If they dont have JS enabled, it will do nothing and they'll just get the 1024 version.
__________________
PHP builder Online Community Manager
yes, but then for any res larger than 1024, the images will be distorted. the page is graphical, not tables and colors
i would do ur idea, but i really want this to be 100% automatic. or, wait, r u saying that i make 2 versions of each page, and the js will automatically redirect to the % page?
Could do that, or you could use a JS function to change the images and table size if they have JS enabled and the res is a certain size. Whichever way you think is easier
__________________
PHP builder Online Community Manager