Mam problem z ustawianiem tla dla diva, a mianowicie skrypt dziala tylko pod firefoxem, IE wyrzuca błedy a opera nie chce zmienić tła. Kawalek skryptu, ktory stwarza problemy wyglada tak:
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 );
        }

html wyglada tak:
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  5. <head>
  6. <link rel="stylesheet" type="text/css" media="all" href="/job/index.php?module=gettext&dir=styles&file=shapes.css"/>
  7. <link rel="stylesheet" type="text/css" media="all" href="/job/index.php?module=gettext&dir=styles&file=colors.css"/>
  8. <script src="/job/index.php?module=gettext&dir=scripts&file=wprowadzaniezmian.js"></script>
  9. <script src="/job/index.php?module=gettext&dir=scripts&file=prototype.js"></script>
  10. </head>
  11. <body onload="zaladuj('/job/index.php?module=xml&dzial=intro');">
  12.  
  13. <div id="wszystko"></div>
  14. </body>
  15. </html>

funkcja $() dziala tak jak getElementById()