When I use methods that “append” data to existing elements using prototype/jquery, is it a good practice to wrap such logic inside document.observe("dom:loaded", foo)/$(document).ready(foo) functions?
When I use methods that append data to existing elements using prototype/jquery, is it
Share
Well, considering referencing elements before DOM/window ready will not work unless it’s the
htmlelement or you are injecting it after the element in the markup directly, yes it’s the only way to really get it done.The above would fail and return null.