Elwood: Dynamisches Javascript nach Ajax Aufruf

Beitrag lesen

Code der von Ajax empfangen wird Teil 1:


<TABLE class="parmView">
<TBODY>
<TR>
<TD class="parmView" colSpan="2">
<SCRIPT language="javascript" type="text/javascript">
  var array = new Object();
  function fRefresh(src){
  var e1 = document.getElementById("V_JKVPP000000002");
  var e2 = document.getElementById("V_JKVPP000000003");
  var e3 = document.getElementById("V_JKVPP000000004");
  var e4 = document.getElementById("V_JKVPP");
  var eo1 = e1.options;
  var eo2 = e2.options;
  var eo3 = e3.options;
  if(src <= 3){
    for(var i=e4.length-1;i>=0;i--){
      e4.remove(i);
    }
    if(src <= 2){
      for(var i=e3.length-1;i>=0;i--){e3.remove(i);}
      if(src == 1){
        for(var i=e2.length-1;i>=0;i--){e2.remove(i);}
          try{
            for(var p in array[eo1[e1.selectedIndex].value]){
              var entry = document.createElement("option");
              nOpt=null;
              if(document.all){nOpt=e2.length;}
              entry.text=p;
              entry.value=p;
              e2.add(entry,nOpt);
            }
          }catch(e){}
        }
        try{
          for(var p in array[eo1[e1.selectedIndex].value][eo2[e2.selectedIndex].value]){
            var entry = document.createElement("option");
            nOpt=null;
            if(document.all){nOpt=e3.length;}
            entry.text=p;
            entry.value=p;
            e3.add(entry,nOpt);
          }
        }catch(e){}
      }
      try{
        for(var p in array[eo1[e1.selectedIndex].value][eo2[e2.selectedIndex].value][eo3[e3.selectedIndex].value]){
          var entry = document.createElement("option");
          nOpt=null;
          if(document.all){nOpt=e4.length;}
          entry.text=p;
          entry.value=array[eo1[e1.selectedIndex].value][eo2[e2.selectedIndex].value][eo3[e3.selectedIndex].value][p];
          e4.add(entry,nOpt);
        }
      }catch(e){}
    }
  }
  array["Ist"]=new Object();
  array["Ist"]["Definitiv"]=new Object();
  array["Ist"]["Definitiv"]["2007"]=new Object();
  array["Ist"]["Definitiv"]["2007"]["März"]                                                                                                                          ="A1B2007C0001D0001E0012F0003";
  array["Ist"]["Definitiv"]["2007"]["Februar"]                                                                                                                                                                                            ="A1B2007C0001D0001E0012F0002";
  array["Ist"]["Definitiv"]["2007"]["Januar"]                                                                                                                                                                                             ="A2B2007C0001D0001E0012F0001";
  array["Ist"]["Definitiv"]["2006"]=new Object();
  array["Ist"]["Definitiv"]["2006"]["Dezember"]                                                                                                                                                                                           ="A2B2006C0001D0001E0012F0012";
  array["Ist"]["Definitiv"]["2006"]["November"]                                                                                                                                                                                           ="A2B2006C0001D0001E0012F0011";
  array["Ist"]["Definitiv"]["2006"]["Oktober"]                                                                                                                                                                                            ="A2B2006C0001D0001E0012F0010";
  array["Ist"]["Definitiv"]["2006"]["September"]                                                                                                                                                                                          ="A1B2006C0001D0001E0012F0009";
  array["Ist"]["Definitiv"]["2006"]["August"]                                                                                                                                                                                             ="A2B2006C0001D0001E0012F0008";
  array["Ist"]["Definitiv"]["2006"]["Juli"]                                                                                                                                                                                               ="A2B2006C0001D0001E0012F0007";
  array["Ist"]["Definitiv"]["2006"]["Juni"]                                                                                                                                                                                               ="A2B2006C0001D0001E0012F0006";
  array["Ist"]["Definitiv"]["2006"]["Mai"]                                                                                                                                                                                                ="A2B2006C0001D0001E0012F0005";
  array["Ist"]["Definitiv"]["2006"]["April"]                                                                                                                                                                                              ="A2B2006C0001D0001E0012F0004";
  array["Ist"]["Definitiv"]["2006"]["März"]                                                                                                                                                                                               ="A2B2006C0001D0001E0012F0003";
  array["Ist"]["Definitiv"]["2006"]["Februar"]                                                                                                                                                                                            ="A2B2006C0001D0001E0012F0002";
  array["Ist"]["Definitiv"]["2006"]["Januar"]                                                                                                                                                                                             ="A2B2006C0001D0001E0012F0001";
  array["Ist"]["Definitiv"]["2005"]=new Object();
  array["Ist"]["Definitiv"]["2005"]["Dezember"]                                                                                                                                                                                           ="A2B2005C0001D0001E0012F0012";
  array["Ist"]["Definitiv"]["2005"]["November"]                                                                                                                                                                                           ="A2B2005C0001D0001E0012F0011";
  array["Ist"]["Definitiv"]["2005"]["Oktober"]                                                                                                                                                                                            ="A2B2005C0001D0001E0012F0010";
  array["Ist"]["Definitiv"]["2005"]["September"]                                                                                                                                                                                          ="A2B2005C0001D0001E0012F0009";
  array["Ist"]["Definitiv"]["2005"]["August"]                                                                                                                                                                                             ="A2B2005C0001D0001E0012F0008";
  array["Ist"]["Definitiv"]["2005"]["Juli"]                                                                                                                                                                                               ="A2B2005C0001D0001E0012F0007";
  array["Ist"]["Definitiv"]["2005"]["Juni"]                                                                                                                                                                                               ="A2B2005C0001D0001E0012F0006";
  array["Ist"]["Definitiv"]["2005"]["Mai"]                                                                                                                                                                                                ="A2B2005C0001D0001E0012F0005";
  array["Ist"]["Definitiv"]["2005"]["April"]                                                                                                                                                                                              ="A2B2005C0001D0001E0012F0004";
  array["Ist"]["Definitiv"]["2005"]["März"]                                                                                                                                                                                               ="A2B2005C0001D0001E0012F0003";
  array["Ist"]["Definitiv"]["2005"]["Februar"]                                                                                                                                                                                            ="A2B2005C0001D0001E0012F0002";
  array["Ist"]["Definitiv"]["2005"]["Januar"]                                                                                                                                                                                             ="A2B2005C0001D0001E0012F0001";
  array["Ist"]["Definitiv"]["2004"]=new Object();
  array["Ist"]["Definitiv"]["2004"]["Dezember"]                                                                                                                                                                                           ="A2B2004C0001D0001E0012F0012";
  array["Ist"]["Definitiv"]["2004"]["November"]                                                                                                                                                                                           ="A2B2004C0001D0001E0012F0011";
  array["Ist"]["Definitiv"]["2004"]["Oktober"]                                                                                                                                                                                            ="A2B2004C0001D0001E0012F0010";
  array["Ist"]["Definitiv"]["2004"]["September"]                                                                                                                                                                                          ="A2B2004C0001D0001E0012F0009";
  array["Ist"]["Definitiv"]["2004"]["August"]                                                                                                                                                                                             ="A2B2004C0001D0001E0012F0008";
  array["Ist"]["Definitiv"]["2004"]["Juli"]                                                                                                                                                                                               ="A2B2004C0001D0001E0012F0007";
  array["Ist"]["Definitiv"]["2004"]["Juni"]                                                                                                                                                                                               ="A2B2004C0001D0001E0012F0006";
  array["Ist"]["Definitiv"]["2004"]["Mai"]                                                                                                                                                                                                ="A2B2004C0001D0001E0012F0005";
  array["Ist"]["Definitiv"]["2004"]["April"]                                                                                                                                                                                              ="A2B2004C0001D0001E0012F0004";