dojox/html/_base (version 1.10)

See the dojox/html/_base reference documentation for more information.

Method Summary

Methods

_adjustCssPaths(cssUrl,cssText)
Defined by dojox/html/_base

adjusts relative paths in cssText to be relative to cssUrl a path is considered relative if it doesn't start with '/' and not contains ':'

Say we fetch a HTML page from level1/page.html It has some inline CSS:

@import "css/page.css" tv, screen;
...
background-image: url(images/aplhaimage.png);

as we fetched this HTML and therefore this CSS from level1/page.html, these paths needs to be adjusted to:

@import 'level1/css/page.css' tv, screen;
...
background-image: url(level1/images/alphaimage.png);

In IE it will also adjust relative paths in AlphaImageLoader()

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/alphaimage.png');

will be adjusted to:

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='level1/images/alphaimage.png');

Please note that any relative paths in AlphaImageLoader in external css files wont work, as the paths in AlphaImageLoader is MUST be declared relative to the HTML page, not relative to the CSS file that declares it

Parameter Type Description
cssUrl undefined
cssText undefined
Returns:undefined
_adjustHtmlPaths(htmlUrl,cont)
Defined by dojox/html/_base
Parameter Type Description
htmlUrl undefined
cont undefined
Returns:undefined
_ContentSetter()
Defined by dojox/html/_base
_snarfScripts(cont,byRef)
Defined by dojox/html/_base

strips out script tags from cont

Parameter Type Description
cont undefined
byRef undefined

byRef = {errBack:function(){/add your download error code here/, downloadRemote: true(default false)}} byRef will have {code: 'jscode'} when this scope leaves

Returns:undefined
_snarfStyles(cssUrl,cont,styles)
Defined by dojox/html/_base
Parameter Type Description
cssUrl String
cont String
styles Array
Returns:undefined
evalInGlobal(code,appendNode)
Defined by dojox/html/_base
Parameter Type Description
code undefined
appendNode undefined
set(node,cont,params)
Defined by dojox/html/_base

inserts (replaces) the given content into the given node

Parameter Type Description
node DomNode

the parent element that will receive the content

cont String | DomNode | NodeList

the content to be set on the parent element. This can be an html string, a node reference or a NodeList, dojo/NodeList, Array or other enumerable list of nodes

params Object
Optional

Optional flags/properties to configure the content-setting. See dojo.html._ContentSetter

Examples

Example 1

A safe string/node/nodelist content replacement/injection with hooks for extension Example Usage:

dojo.html.set(node, "some string");
dojo.html.set(node, contentNode, {options});
dojo.html.set(node, myNode.childNodes, {options});
Error in the documentation? Can’t find what you are looking for? Let us know!