Effect:
Calls function pageInit(...) to reset the color style of this
area and to bind function
btnAffair(domAffairSrc, strExtraMsg) onto the click affair of
.
Effective Time:
After all resources are fully loaded or ready
- including the DOM tree, all images, all media elements, etc.
Advantages:
The native basic way with no external dependencies.
Disadvantages:
Loading all images and media takes more time before user can operate,
especially while the images, media elements and other resources are large.
There is no simple way to make user operation available
only after the DOM tree is parsed,
but before images, media elements and other resources are fully loaded.
Description:
A iQuery way to do some initialize jobs by executing some
javascript before user operation, to replace
<body onload="javascript: ...">.
Effective Code Position:
In sector <script ...>...</script>
Effect:
Also calls function pageInit(...) to reset the color style of
this area and to bind function
btnAffair(domAffairSrc, strExtraMsg) onto the click affair of
.
Effective Time:
After the DOM tree is parsed,
before images, media elements and other resources are fully loaded.
Advantages:
Reduced the waiting time before user operation is available,
especially while the images, media elements and other resources are large.
Disadvantages:
jQuery way refers to one or more somehow big files,
but many of whose feature might not be used.
May cause a waste of space and transmission,
especially on memory and flow constrained mobile devices.