Home:ALL Converter>Interact with DOM before DOMReady fires

Interact with DOM before DOMReady fires

Ask Time:2012-11-14T14:58:44         Author:Jacques Blom

Json Formatter

I would like to interact with the DOM immediately when the element becomes available. I can do this with a setInterval, but it won't work with Crossrider because the js that can interact with the DOM is only loaded once the DOM is ready. Any way to get aroind this?

Thanks

Author:Jacques Blom,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13374337/interact-with-dom-before-domready-fires
Shlomo :

The current API doesn't officially support this feature at this time.\n\nHowever, you're welcome to try our new appAPI.dom methods which work in Chrome and Firefox but are currently undocumented until they are officially released. The new methods are pretty self-explanatory, so I've listed them here with a brief description:\n\n\nappAPI.dom.onDocumentStart.addJS(String jsCode, [Array siteList])This method adds the specified jsCode when the document starts to load. Optionally specify an array of strings/regex expressions (see http://docs.crossrider.com/#!/api/appAPI-method-isMatchPages for examples) specifying which URLs to add the code to.\nappAPI.dom.onDocumentStart.addCSS(String cssRules, [Array siteList])This method adds the specified cssRules when the document starts to load. Optionally specify an array of strings/regex expressions (see http://docs.crossrider.com/#!/api/appAPI-method-isMatchPages for examples) specifying which URLs to add the CSS to.\n",
2012-11-15T20:29:36
yy