W3C standard vs proprietary JET APIs?

When one must use proprietary JET APIs and when can one use standard W3C APIs or third parties such as [DOM Level 2 events][1] or jQuery `document.ready`? Why do these conflicting APIs exist? e.g. JET API: JET.onLoad(function(){ alert(“onLoad is called”); }) vs jQuery: $(document).ready (function(){ alert(“onLoad is called”); }) vs HTML 4.01: addEventListener('load',function(){ alert(“onLoad is called”); }) [1]:
http://www.w3.org/TR/DOM-Level-2-Events/events.html [2]:
http://www.w3.org/TR/selectors-api/

Best Answer

  • I believe that `JET.onLoad` is not the same as `$(document).ready`. JET has some initialisation to do before it's ready to work, so the onLoad method accommodates that. If that is indeed the case, it would be possibly better to rename the function to `whenLoaded` or something similar.

Answers

  • So as a chain to `document.onload` but still before the DOM is actually ready? Many developers would appreciate a convenience for both the DOM and JET being ready.
  • Possibly but I see them as separate concerns. For me the bigger issue is the slightly opaque distinction between onLoad and init, e.g. JET.onLoad(initApp); JET.init({ ID: "JETSample" });
  • JET onLoad event serve different purpose than DOM Ready, the event tells you when you can start accessing JET functionalities so it can be before or after DOM ready. Anyway, generally, we do JET.init() in the DOM Ready event so JET Onload event will be coming after DOM Ready.
  • Ported to external eikondeveloper portal.