simpli Posted April 6, 2009 Share Posted April 6, 2009 Hi, I think I need to create a custom even when the table I'm building is done loading so I can collapse the different tbodys in it. Can anyone has a simple example of an event creation and further usage? I tried finding some in the internet but they look either fishy or complicated. Thanks, J-R Quote Link to comment Share on other sites More sharing options...
corbin Posted April 6, 2009 Share Posted April 6, 2009 There's no way to create a custom event without modifying browser code. (Well, technically, you could but it would have to rely on other events and involve looping.) You could just put JS code right after the table, by the way. You could also just use a document.onload. Or, with a framework like jQuery, you could do onready. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 6, 2009 Share Posted April 6, 2009 if you use jquery (if you don't you should!) http://docs.jquery.com/Events/load#fn... $('table').load(function(){ ... }; ); obviously that would run on ALL tables in your page so you can make it more specific with a class or id or what ever you choose.. Quote Link to comment Share on other sites More sharing options...
corbin Posted April 6, 2009 Share Posted April 6, 2009 You can attach events with jQuery? Hrmmm, I think I knew that at some point, but I forgot it. I wonder if there is some method I don't know about to attach an event to a DOM object or something, or if jQuery just loops or something. I would imagine there's a method I don't know about since script execution would hang if not. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 7, 2009 Share Posted April 7, 2009 @corbin???? you can do' anything' with jQuery Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.