As you know, you can insert some content in any HTML page. You can insert content by using document.write()
or by using the property innerHTML
in a DOM object. Also, you can use an existing TAG in order to add/remove elements from its. For example, you can add a Javascript with:
function addScripting(s)
{
var scriptNode = document.createElement('script');
document.getElementsByTagName("head")[0].appendChild(scriptNode);
scriptNode.language='javascript';
scriptNode.src=s;
}
Of course, you can also add a CSS style with:
var cssNode = document.createElement('link');
cssNode.setAttribute('rel', 'stylesheet');
cssNode.setAttribute('type', 'text/css');
cssNode.setAttribute('href', cssfile );
document.getElementsByTagName('head')[0].appendChild(cssNode);