need the text to go away when clicked
This is a discussion on need the text to go away when clicked within the Graphic Design and Web Design Help, part of the General category; Indeed. Another thing to point out is that adding these event handlers needs to be done after the page has loaded which means that the functionality is only available when all of the elements ...
-
likes chips.
Indeed. Another thing to point out is that adding these event handlers needs to be done after the page has loaded which means that the functionality is only available when all of the elements on the page have loaded (don't forget that you could have advertisements on the page linked to external servers which can affect the onload status of the page), whereas, inline statements are available as soon as the element is rendered; making inline statements more efficient.
-
Mr. Tambourine Man

Originally Posted by
Scriptage
don't forget that you could have advertisements on the page linked to external servers which can affect the onload status of the page
Yeah that's a big one against other methods. Wouldn't consider using anything but inline if i had ads in the site.
If you're using a server-side script, you can also have it add the inline onclick events where they're needed, which is a way to separate it from the markup. Although it's probably mostly unnecessary.
-
Junior Member

Originally Posted by
Arkady
Are seriously suggesting that the onclick event has been deprecated.
Yes. Much better to use JavaScript to observe events after page loads. onclick="" is deprecated. EDIT: I recant that; it's my personal preference that it's better to observe events after the page has loaded. An example (uses fastInit and prototype):
HTML Code:
<script type="text/javascript">
var someFunction = function(e)
{
doSomething();
e.stop();
}
FastInit.addOnLoad(function(){
$('someLink').observe(someFunction.bindAsEventListener({});
});
</script>
<a href="/javascript_required.html" id="someLink">This link does something...</a>
--
Joshua Gitlin
Website Developer
Welcome To Site Palette - sitepalette.com
Last edited by hmbl programmer; 10-03-2009 at 06:47 PM.
-
likes chips.
For the love of God don't use Javascript frameworks; and no onclick is not deprecated, see my earlier posts.
-
Design Guru
onclick="" is deprecated.
There it is again. Would you like to share with us the relevant W3C documents or RFC's that support this. I have trawled the W3C and cannot find any such reference.
-
Junior Member

Originally Posted by
Scriptage
For the love of God don't use Javascript frameworks
Why do you feel that way?
-
Junior Member

Originally Posted by
Arkady
There it is again. Would you like to share with us the relevant W3C documents or RFC's that support this. I have trawled the W3C and cannot find any such reference.
You may be right. Probably the word "discouraged" would be more appropriate than "deprecated", reason being the separation of presentation and content. I'll try to find a specific W3C document to back me up here.
-
likes chips.
Why do you feel that way?
Why have code for AJAX on the page when you don't use it? The most compressed version of jQuery is 15k; that's a lot of superfluous code. When somebody else does the coding you lose control of memory management, which is bad. It's just a sucky way to program.
-
Design Guru

Originally Posted by
hmbl programmer
Probably the word "discouraged" would be more appropriate than "deprecated"
I'm sorry; discouraged by whom exactly?
-
Experienced Member
At the risk of repeating myself:

Originally Posted by
jameson
Really, there's nothing wrong with using onClick in the instance this thread was originally about. The original poster ended up going that route, and that's just fine for a quick fix on a temporary website.
It is the opinion of many, however, (myself included) that the most logical way to design a website is by separating markup (HTML), presentation (CSS), and behavior (JavaScript). Of course, it's just an opinion - I also think it's crazy to split CSS files into typography, layout, etc., but some think that's a good idea.
The bottom line is this: Use the best solution for each problem.
Similar Threads
-
By KyleOpium in forum Graphic Design & Web Design Critique
Replies: 5
Last Post: 09-02-2009, 10:17 AM
-
By a3dy in forum Design and Print Software
Replies: 1
Last Post: 10-03-2008, 01:47 PM
-
By katie roos in forum General Web Design Forum
Replies: 0
Last Post: 28-01-2008, 03:05 PM
-
By Toon in forum Off Topic
Replies: 4
Last Post: 24-01-2008, 07:12 AM
-
By Dinx in forum Graphic Design and Web Design Help
Replies: 6
Last Post: 07-12-2007, 11:42 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Check the forum often for the latest design announcements. Everything from graphic design and web design, to films and music.
Estetica is a great place for people to get together and help each other out.
Web Hosting - UK Web Hosting services for business or personal website hosting needs.
Dedicated Servers - A full range of Managed Dedicated Server solutions suitable for all your requirements.
Online Backup – Backup Technology offers competitive online backup, disaster recovery and business continuity.
Web Design UK | Vision.To Design | Leaflet Printing | Estetica Design Forum's Privacy Policy | Pocono Web | Flyer Printing | Photography Blog | Graphic Design Links
Graphic Design Social Network | Logo Design | Brochure Printing | Land for sale | Leaflet Printing | CNC Precision Engineering | Graphic Design Blog
Custom Logo Design - $149 Only | Affordable Print Design Templates | Small Business Logo Design | Company Logo Design
Logo Design Service | Logo Design Firm | Logo Design Reseller | Custom Logo Design | Letterhead Printing | Flyer Printing | Business Card Printing
Online Backup | T-Shirt Printing | Personalised Mugs | Canvas Printing | Tradeshow Ideas
Bookmarks