> Ignacio Coloma wrote:
>> Hi, I know that prototype should be kept as simple as possible but
>> this is a common use case IMHO.
>>
>> This is a technique to avoid the brief "flash" that happens when you
>> want a DOM node hidden if the browser has javascript, but be shown if
>> it does  not:
>> ...
>>
> Why not use <noscript>?  What are the use cases?

<noscript> is kind of the reverse of what he's talking about. In  
<noscript> you get the element only when scripting is not enabled. In  
his example, you ALWAYS get the element, but when scripting is  
enabled, it is hidden.

This is a pretty common technique. So common, I usually have a CSS  
class specifically for it: .hideWhenScripting. The easiest example to  
understand would be:

<input type="text" onkeyup="liveSearch"><input type="submit"  
class="hideWhenScripting" value="Search">

Of course, the onkeyup attribute is bogus, but you get the idea. The  
input performs live search when JavaScript is enabled and the submit  
button is hidden, but when JavaScript is disabled, we want to display  
the Search button to search on the server.


--
Jeff Watkins
ui wrangler
online apple store

The online store is looking for a JavaScript superstar with a strong  
software engineering background. Is that you? Drop me an email if  
you're interested.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to