![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 149
Rep Power: 3
![]() |
Hidden unless Javascript enabled?
Could someone tell me how to have there be a message if Javascript is disabled, but have the message not appear in the first place if Javascript is enabled?
I know I could just write the message in regular html and then clear it with javascript with <body onLoad>, but I don't want to have the message there while the page is loading. Is there maybe some PHP thing I could use, similar to @$REMOTE_ADDR to detect whether the user has Javascript enabled before the page is sent? |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 3
![]() |
<noscript> Put your message here... </noscript>
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
The browser is not required to send you that information. Think of it like this: you could read the RFCs and write some code to ask for a resource from some server. This would be 'your' browser. You might or might not write it to conform to 'tradition' or 'common practice.' Always bear this in mind when you are trying to wring functionality from two separate pieces of code, one residing on some client's machine, and one residing on your server, and the two authors never heard of each other and don't give a rat's ass what the other might want, outside of compliance with the RFCs. Should you happen to luck out and find a non-standard facility on one end that does what you want, you still have no guarantees about the other end. All that said, look up get_browser and HTTP_USER_AGENT in your PHP docs. If you're looking for universal miracles, though, you might should oughtta buy a chicken and get prepared to wring its neck and offer it up.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 149
Rep Power: 3
![]() |
That noscript tag worked fine for me, thanks =)
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|