Kod
try
{
/* skroty do wazniejszych odwolan */
var Head = odpowiedz.responseXML.getElementsByTagName('head')[0];
var Body = odpowiedz.responseXML.getElementsByTagName('body')[0];
/* tlo */
$("wszystko").style.backgroundImage = 'url(\'' + Head.getElementsByTagName('background-image')[0].firstChild.data + '\');';
/* w background-image znajduje sie "images/back01.jpg"*/
}
catch (e)
{
alert('Przy przetwrzaniu pliku wystapil nastepujacy blad:\n' + e.message );
}
{
/* skroty do wazniejszych odwolan */
var Head = odpowiedz.responseXML.getElementsByTagName('head')[0];
var Body = odpowiedz.responseXML.getElementsByTagName('body')[0];
/* tlo */
$("wszystko").style.backgroundImage = 'url(\'' + Head.getElementsByTagName('background-image')[0].firstChild.data + '\');';
/* w background-image znajduje sie "images/back01.jpg"*/
}
catch (e)
{
alert('Przy przetwrzaniu pliku wystapil nastepujacy blad:\n' + e.message );
}
html wyglada tak:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <link rel="stylesheet" type="text/css" media="all" href="/job/index.php?module=gettext&dir=styles&file=shapes.css"/> <link rel="stylesheet" type="text/css" media="all" href="/job/index.php?module=gettext&dir=styles&file=colors.css"/> </head> <body onload="zaladuj('/job/index.php?module=xml&dzial=intro');"> </body> </html>
funkcja $() dziala tak jak getElementById()