Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 24th, 2006, 4:10 PM   #1
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
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?
Writlaus is offline   Reply With Quote
Old Apr 24th, 2006, 4:55 PM   #2
Agent 47
Hobbyist Programmer
 
Agent 47's Avatar
 
Join Date: Nov 2005
Posts: 122
Rep Power: 3 Agent 47 is on a distinguished road
<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"
Agent 47 is offline   Reply With Quote
Old Apr 24th, 2006, 5:00 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Apr 25th, 2006, 10:52 PM   #4
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
That noscript tag worked fine for me, thanks =)
Writlaus is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:22 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC