Georg: Style nach obj.innerHTML

Beitrag lesen

Hi,

wie lautet denn anschließend der generierte Code, und wo unterscheidet er sich vom ursprünglichen?

Cheatah

Hallo Cheatah,
hier der komplette Code:
//--------------------------Index_Seite
<html>
<head>
<script type="text/javascript" language="JavaScript1.2" src="js/menulng.js"></script>
<link rel="stylesheet" type="text/css" href="css/menustyle.css">
</head>

<div id="navcontainer">
 <ul id="navlist">
 <li><a href="home.html">Home</a></li>
 <li><a href="products.html">Products</a></li>
 <li id="active"><a id="current" href="services.html">Services</a></li>
 <li><a href="support.html">Support</a></li>
 <li><a href="order.html">Order</a></li>
 <li><a href="about.html">About</a></li>
 </ul>
</div>
<form>
      <input type = "button" value = "Menü ändern"
        onclick = "getMenuDatajs('getmenudata.php', 'navcontainer')">
</form>
</html>

//--------------------ENDE SEITE VORHER-----------------
//----------------INHALT von menulng.js------------------
      var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
        XMLHttpRequestObject = new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
      }

function getMenuDatajs(dataSource, divID)
      {
        if(XMLHttpRequestObject) {
          var obj = document.getElementById(divID);
          XMLHttpRequestObject.open("GET", dataSource);

XMLHttpRequestObject.onreadystatechange = function()
          {
            if (XMLHttpRequestObject.readyState == 4 &&
              XMLHttpRequestObject.status == 200) {
                obj.innerHTML = XMLHttpRequestObject.responseText;
            }
          }

XMLHttpRequestObject.send(null);
        }
      }

//-------------------ENDE von menulng.js---------------
//------------------Inhalt von getmenudata.php-------
<?php
session_start();

if (!isset($_POST['sprache'])) {$_POST['sprache']='dt';}
if (!isset($_POST['menu']))    {$selected="Login";}

$sprachpath='sprache/'.$_POST['sprache'].'/menu.lng';
include_once($sprachpath);

$menu='';
       $anzahl = count($menuname);
       for($count = 0; $count < $anzahl; $count++)
          {
          $zeile='<li';
          if ($menuname[$count] == $selected){
                  $zeile.= ' id="active"><a id="current"';
           }
           $zeile.='><a href="' . $menulink[$count] . '">' . $menuname[$count] . '</a> </li>'.chr(13);
          $menu.=$zeile;
          }
        echo  $menu;
?>
//--------------------ENDE von getmenudata.php-------

War das gefragt ?

Gruß Gerog