Javascript, CSS e cambio stile

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Davide R.

    #1

    Javascript, CSS e cambio stile

    Ciao a tutti,
    vi spiego il mio problema

    Ho una pagina HTML che referenzia un CSS esterno.
    Ho alcuni elementi HTML che appartengolo ad una classe (chiamiamola
    "class1").
    Avrei la necessità, alla pressione di un tasto di lanciare un javascript che
    mi cambia un attributo della classe "class1" (per esempio 'font-size', ma
    potrebbe essere qualsiasi altro attributo).
    Teoricamente potrei fare un loop in tutti gli elementi della pagina e
    cambiare le caratteristiche dello stile di ciascun elemento appartenente
    alla classe "class1" (oppure cambiare addirittura il nome della classe).
    Mi chiedevo invece se non era possibile cambiare le caratteristiche della
    classe "class1" in modo che tutti gli elementi appartenenti a quella classe
    "magicament e" ereditino il cambiamento (eviterei così il loop).

    E' possibile una cosa del genere?

    Ah, la mia applicazione web sarà utilizzata solo con IE5 per cui vanno bene
    anche consigli non "standard".

    Grazie in anticipo,
    Davide.


  • Thomas 'PointedEars' Lahn

    #2
    Re: Javascript, CSS e cambio stile

    Davide R. wrote:
    [color=blue]
    > Avrei la necessità, alla pressione di un tasto di lanciare un javascript che
    > mi cambia un attributo della classe "class1" (per esempio 'font-size', ma
    > potrebbe essere qualsiasi altro attributo).
    > [...]
    > Mi chiedevo invece se non era possibile cambiare le caratteristiche della
    > classe "class1" in modo che tutti gli elementi appartenenti a quella classe
    > "magicament e" ereditino il cambiamento (eviterei così il loop).
    >
    > E' possibile una cosa del genere?[/color]

    Please search before you post:
    <news:4095A319. 5050405@Pointed Ears.de>

    BTW:
    AFAIS chances to get a response are higher if you write
    in English here. But it.comp.lang.ja vascript exists, too.


    PointedEars

    Comment

    • Alberto

      #3
      Re: Javascript, CSS e cambio stile

      A lot of css manipulation functions (that manipulate also whole classes or
      single rules within them) is at


      I think there you can find the script(s) you're looking for (for NS5 and IE5
      both), or something very very close indeed
      ciao
      Alberto
      [color=blue][color=green]
      > > Avrei la necessità, alla pressione di un tasto di lanciare un javascript[/color][/color]
      che[color=blue][color=green]
      > > mi cambia un attributo della classe "class1" (per esempio 'font-size',[/color][/color]
      ma[color=blue][color=green]
      > > potrebbe essere qualsiasi altro attributo).
      > > [...]
      > > Mi chiedevo invece se non era possibile cambiare le caratteristiche[/color][/color]
      della[color=blue][color=green]
      > > classe "class1" in modo che tutti gli elementi appartenenti a quella[/color][/color]
      classe[color=blue][color=green]
      > > "magicament e" ereditino il cambiamento (eviterei così il loop).
      > >
      > > E' possibile una cosa del genere?[/color]
      >[/color]


      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Javascript, CSS e cambio stile

        Alberto wrote:
        [color=blue]
        > A lot of css manipulation functions (that manipulate also whole classes or
        > single rules within them) is at
        > http://www.unitedscripters.com/scripts/css1.html[/color]

        This is just yet another junk produced by script kiddies. eval()
        everywhere, unchecked DOM mixes everywhere, spaghetticode everywhere.
        I strongly recommend *against* it.
        [color=blue]
        > [Top post][/color]

        Please do not do that, see the FAQ.


        PointedEars

        Comment

        • Alberto

          #5
          Re: Javascript, CSS e cambio stile

          Where have you found eval() calls in those codes?
          "Cannot find string "eval("

          As for the junk, that website is ranked among the top 20 about javascript.

          And again:
          "Cannot find string "eval("
          in the whole document.

          Also, please, identify what you mean by spaghetti codes; since it is
          "everywhere " accordingly to you, point it out in these functions:

          function addClass(sheetI ndex, definition, optionalIndex){
          if(!document.ge tElementById || !document.style Sheets.length){ return
          false; };
          sheetIndex=(she etIndex && !isNaN(parseFlo at(sheetIndex)) )?
          parseFloat(shee tIndex):0;
          if(sheetIndex>d ocument.styleSh eets.length-1){ return false; };
          if(!definition || definition.inde xOf("{")==-1 ||
          definition.inde xOf("}")==-1 ){ return false; };
          var obj=document.st yleSheets[sheetIndex];
          optionalIndex=( !optionalIndex) ?1:
          (obj.rules)?
          obj.rules.lengt h : obj.cssRules.le ngth;
          if(obj.addRule) {
          definition=defi nition.split("{ ");
          obj.addRule(def inition[0], definition[1], optionalIndex);
          }
          else if(obj.insertRu le){
          obj.insertRule( definition, optionalIndex);
          };
          return true;
          /* keep this comment to reuse freely:
          http://www.unitedscripters.com */};

          function allClasses(inde xOrObject){
          if(!document.ge tElementById || !document.style Sheets.length){ return
          false; };
          indexOrObject=( indexOrObject && !isNaN(parseFlo at(indexOrObjec t)))?
          parseFloat(inde xOrObject):
          (typeof(indexOr Object)=="objec t")?indexOrObje ct:0;
          var isObj=(typeof(i ndexOrObject)== "object")?1 :0;
          if(!isObj && typeof(document .styleSheets[indexOrObject])=="undefined") {
          return false; };
          var output=new Array(0);
          var RULES=( typeof(document .styleSheets[0].rules)!="undef ined" )?
          "rules":"cssRul es";
          var object=(!isObj) ?
          document.styleS heets[indexOrObject]:indexOrObject;
          for(var i=0; i<object[RULES].length; i++){
          var OL=++output.len gth-1;
          output[OL]=
          new Array(
          object[RULES][i],
          object[RULES][i].selectorText,
          new Array(0), new Array(0), new Object(), i, indexOrObject
          );
          for(var grab in object[RULES][i].style){
          var current=object[RULES][i].style[grab];
          if(current!="" && typeof(current) !="function") {
          output[OL][2][ ++output[OL][2].length-1 ]=grab;
          output[OL][3][ ++output[OL][3].length-1 ]=current;
          output[OL][4]=object[RULES][i].style;
          };
          };
          };
          return output;/* keep this comment to reuse freely:
          http://www.unitedscripters.com */};

          function findClass(wante dClass, beyondMatch){
          /*REQUIRES the allClasses function in the same document*/
          if(!wantedClass || !document.style Sheets){return false;};
          if(!window["allClasses "]){ return false; };
          var tempClasses=new Array(0);
          this.compare=fu nction(arg1, arg2){
          if(arg1==arg2){ return true}
          else{
          arg2=arg2.repla ce(/\./gi,"");
          var expr=new RegExp("\\b"+ar g2+"\\b");
          return expr.test(arg1) ;
          };
          }
          var output=new Array(0);
          outer:
          for(var s=document.styl eSheets.length-1; s>=0; s--){
          tempClasses=all Classes(s);
          for(var t=0; t<tempClasses.l ength;t++){
          if(this.compare (tempClasses[t][1], wantedClass)){
          var OL=++output.len gth-1;
          output[OL]=new Array(0,0,0,0)
          output[OL][0]=s;
          output[OL][1]=t;
          output[OL][2]=document.style Sheets[s];
          output[OL][3]=tempClasses[t];
          if(!beyondMatch ){ return output; }
          };
          };
          };
          return output;/* keep this comment to reuse freely:
          http://www.unitedscripters.com */}

          function readClass(cssIn dex, ruleIndex, property, optionalID){
          if(!document.ge tElementById){ return false; };
          if(optionalID){
          return (!document.getE lementById(opti onalID))?
          false:(document .getElementById (optionalID)[property])
          };
          if(!document.st yleSheets.lengt h){ return false ;}
          cssIndex=(cssIn dex && !isNaN(parseFlo at(cssIndex)))? parseFloat(cssI ndex):0;
          ruleIndex=(rule Index && !isNaN(parseFlo at(ruleIndex))) ?
          parseFloat(rule Index):0;
          if(cssIndex>doc ument.styleShee ts.length-1){ return false; };
          var RULES=( typeof(document .styleSheets[0].rules)!="undef ined" )?
          "rules":"cssRul es";
          if(ruleIndex>do cument.styleShe ets[cssIndex][RULES].length-1){ return
          false; };
          return document.styleS heets[cssIndex][RULES][ruleIndex].style[property];
          /* keep this comment to reuse freely:
          http://www.unitedscripters.com */}

          function writeClass(cssI ndex, ruleIndex, property, value, optionalID,
          onlyID){
          if(!document.ge tElementById){ return false; };
          if(optionalID){
          if(onlyID){
          return (!document.getE lementById(opti onalID))?
          false:(document .getElementById (optionalID)=va lue)
          }
          else{
          if(typeof(optio nalID)=="string " &&
          !document.getEl ementById(optio nalID)){ return false; };

          if(typeof(optio nalID)=="string "){document.get ElementById(opt ionalID)[propert
          y]=value}
          else{/*an array of IDs!*/
          for(var id=0; id<optionalID.l ength; id++){
          if(!document.ge tElementById(op tionalID[id])){continue};
          document.getEle mentById(option alID[id]).style[property]=value;
          };
          };
          };
          };/*out of if optionalID*/
          if(!document.st yleSheets.lengt h){ return false ;}
          cssIndex=(cssIn dex && !isNaN(parseFlo at(cssIndex)))? parseFloat(cssI ndex):0;
          ruleIndex=(rule Index && !isNaN(parseFlo at(ruleIndex))) ?
          parseFloat(rule Index):0;
          if(cssIndex>doc ument.styleShee ts.length-1){ return false; };
          var RULES=( typeof(document .styleSheets[0].rules)!="undef ined" )?
          "rules":"cssRul es";
          if(ruleIndex>do cument.styleShe ets[cssIndex][RULES].length-1){ return
          false; };
          return
          document.styleS heets[cssIndex][RULES][ruleIndex].style[property]=value;
          /* keep this comment to reuse freely:
          http://www.unitedscripters.com */}




          "Thomas 'PointedEars' Lahn" <PointedEars@nu rfuerspam.de> ha scritto nel
          messaggio news:40AC587A.4 080209@PointedE ars.de...[color=blue]
          > Alberto wrote:
          >[color=green]
          > > A lot of css manipulation functions (that manipulate also whole classes[/color][/color]
          or[color=blue][color=green]
          > > single rules within them) is at
          > > http://www.unitedscripters.com/scripts/css1.html[/color]
          >
          > This is just yet another junk produced by script kiddies. eval()
          > everywhere, unchecked DOM mixes everywhere, spaghetticode everywhere.
          > I strongly recommend *against* it.
          >[color=green]
          > > [Top post][/color]
          >
          > Please do not do that, see the FAQ.
          >
          >
          > PointedEars[/color]


          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Javascript, CSS e cambio stile

            Alberto wrote:
            [color=blue]
            > Where have you found eval() calls in those codes?
            > "Cannot find string "eval("
            >
            > As for the junk, that website is ranked among the top 20 about javascript.
            >
            > And again:
            > "Cannot find string "eval("
            > in the whole document.[/color]

            The whole document you posted the URL of does not contain any script
            example. But when you click the intro image and click the "TO JAVASCRIPTS"
            button, you see a bunch of junk (actually, you see it long before -- or is
            this supposed to be a promotion site for oculists and opticians?), for
            example "Drag a Layer (2) on all browsers with dhtml".

            And that's the polite way of saying it.
            [color=blue]
            > Also, please, identify what you mean by spaghetti codes; since it is
            > "everywhere " accordingly to you, point it out in these functions:
            >
            > [...][/color]

            Yes, that's spaghetti code at its best.
            [color=blue]
            > [Top post][/color]

            Please do not do that, see the FAQ. I'll bet someone told you this before.


            PointedEars, Score adjusted

            Comment

            • Alberto

              #7
              Re: Javascript, CSS e cambio stile

              Really, I'd like a lot if you could point, besides your ears, where you have
              seen eval in that document. One of your arguments is that it is "everywhere "
              (you specify everywhere 3 times).Yet:
              "Cannot find string "eval("

              You can proceed as follows: you go to:

              Once on the page, right click with your mouse wherever in the document where
              you won't see an image. You will see a drop down menu coming down nearby
              your mouse pointer (that arrow moving on the screen you know...), YET don't
              panic: from there you can choose the voice "HTML" or "view Source".

              Once the source is viewed (it may open a new application window, yet don't
              panic!) , please go on the menu, you'd find a voice like "find" under menu
              modify or so: a prompt will pop up (don't panic, that's normal).

              Please insert in that prompt the following string:
              eval(
              then please click: find.
              You will be surprised to see the following answer:
              "cannot find string 'eval('"

              I'd really like now, since you nearly never show up for a constructive
              answer but only to complain with whoever (even when they ask questions you
              refer to the faqs), that you show up to uphold your position, namely that
              you found "eval everywhere, (...)".

              Please explain to us how comes you found "eval everywhere" when the answer
              to a search on the html source is
              "Cannot find string 'eval('"

              Please note that page loads NO external js file. External js files are files
              whose codes are in an external file and not within the body of the document,
              you know...

              Please let us know why you found eval everywhere.

              Additionally, you can if you want search for just "eval" without the
              starting bracket, and you will find ONE instance in the whole document:
              "prevalence of the last style sheet"
              you see pr-eval-ence. the word prevalence is not javascript codes, as
              perhaps your js manual explains to you.

              Also please note that the codes are not commented because the whole document
              of 100Kb is itself made up of comments about how to use the functions.
              Also, those codes are for free: nobody has to pay to use them.
              They are power codes: you can do more than one a thing with one function.
              The arguments are documented in the file. Some guys just write more than 2
              lines saying they found "eval everywhere" you know.
              Also, feel free to provide us with the web url to your website where we can
              find better codes to do all those SAME things you can do with my codes.
              Thank you.

              Please do NOT forget to let us know where you have found "eval everywhere".
              Alternatively, if you have nothing to say or to contribute, don't miss an
              occasion to say nothing: we might end up suspecting you know what you sepak
              about if from time to time you avoid mentioning things which are not in the
              documents you contest.
              Thank you a lot for your meaningful and completely wrong (as proved by the
              facts) comments:

              "cannot find string eval("
              and yet you say:
              "eval everywhere".

              This is called a fact. I assume you know what's the difference between a
              fact and an allegation.
              If I have time maybe I will read your answer, provided I have more time to
              waste with a person who says that he finds "eval everywhere" whereas it is
              not egven present once in the whole document codes.

              Bye have fun- and keep the ears pointed: maybe one day you may end up
              guessing what are those noises in the other room






              "Thomas 'PointedEars' Lahn" <PointedEars@nu rfuerspam.de> ha scritto nel
              messaggio news:40AC587A.4 080209@PointedE ars.de...[color=blue]
              > Alberto wrote:
              >[color=green]
              > > A lot of css manipulation functions (that manipulate also whole classes[/color][/color]
              or[color=blue][color=green]
              > > single rules within them) is at
              > > http://www.unitedscripters.com/scripts/css1.html[/color]
              >
              > This is just yet another junk produced by script kiddies. eval()
              > everywhere, unchecked DOM mixes everywhere, spaghetticode everywhere.
              > I strongly recommend *against* it.
              >[color=green]
              > > [Top post][/color]
              >
              > Please do not do that, see the FAQ.
              >
              >
              > PointedEars[/color]


              Comment

              • Thomas 'PointedEars' Lahn

                #8
                Re: Javascript, CSS e cambio stile

                Alberto wrote:
                [color=blue]
                > Where have you found eval() calls in those codes?
                > "Cannot find string "eval("[/color]

                You have not searched thoroughly enough.
                [color=blue]
                > As for the junk, that website is ranked among the top 20 about javascript.[/color]

                Ranked by whom? Other incompetent script-kiddies, I'll bet.
                [color=blue]
                > And again:
                > "Cannot find string "eval("
                > in the whole document.[/color]

                The whole document you posted the URL of does not contain any script
                example. But when you click the intro image and click the "TO JAVASCRIPTS"
                button, you see a bunch of junk (actually, you see it long before -- or
                is this supposed to be a promotion site for oculists and opticians?), for
                example "Drag a Layer (2) on all browsers with dhtml".

                And that's the polite way of saying it.
                [color=blue]
                > Also, please, identify what you mean by spaghetti codes; since it is
                > "everywhere " accordingly to you, point it out in these functions:
                >
                > [...][/color]

                Yes, that's spaghetti code at its best.
                [color=blue]
                > [Top post][/color]

                Please do not do that, see the FAQ. I'll bet someone told you this before.


                PointedEars, Score adjusted

                Comment

                • Alberto

                  #9
                  Re: Javascript, CSS e cambio stile

                  [color=blue]
                  > You have not searched thoroughly enough.[/color]

                  Please proviude the string in that document where you have found eval then.
                  We are referring to:


                  [color=blue]
                  > Ranked by whom? Other incompetent script-kiddies, I'll bet.[/color]

                  No darling: have you ever heard of google and the alike? Please darling go
                  and see:

                  But that is just an example. Do the same search on Lycos, Altavista, Excite
                  javascript top 20 directories if you want.
                  Not that I feel any special proud about that, but honestly that somebody
                  must show up with false allegations is a TREND that on these groups we can't
                  stand anymore.

                  I am honestly fed up with rude persons on groups that know NOTHING about
                  what they are speaking about and GRATUITOUSLY attack guys who lend help to
                  other guys.

                  Are you sure you know what you're speaking about? In less than 2 minutes you
                  have been able to miss every target.

                  [color=blue]
                  > The whole document you posted the URL of does not contain any script
                  > example.[/color]

                  You're referring to:

                  yes? because there are 10 scripts there.
                  [color=blue]
                  >But when you click the intro image and click the "TO >JAVASCRIPTS"[/color]

                  what "intro image"? Do you have hallucintations ? There is no intro, no flash
                  there. There is JUST a LINK that says "To javascripts" which is the list of
                  the files devoted to javascript on the whole website.

                  [color=blue]
                  > example "Drag a Layer (2) on all browsers with dhtml".[/color]

                  Can you tell the difference between an index that lists the available
                  documents and an individual file? can you tell the difference between the
                  TEXTUAL description of a link (unavoidable a short one) and the URL pointed
                  by a link?



                  Comment

                  • Alberto

                    #10
                    Re: Javascript, CSS e cambio stile

                    [color=blue]
                    > The whole document you posted the URL of does not >contain any script[/color]

                    Here is the source code, the FIRST hundred lines, with the codes, which of
                    course are then displayed on the page in textareas (you know darling, that
                    funny procedure whereas you populate a textarea with a call to
                    toString()...): DO FIND EVAL NOW and do DEMONSTRATE there are no
                    javascripts, please. Now you go till the end of your GRATUITOUS and FALSE
                    allegations darling...

                    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
                    <html>
                    <head>
                    <title>JS: css: The style sheets bonanza (Javascript)</title>
                    <link rel="stylesheet " type="text/css" href="../orange.css">
                    <link rel="stylesheet " type="text/css" href="../red.css">

                    <script language="JavaS cript" src="../miscella.js">
                    </script>
                    <script><!--
                    function findSheet(chara cteristic, characteristicI sHREF){
                    if(!document.ge tElementById || !document.style Sheets.length){ return
                    false; };
                    if(typeof(chara cteristic)=="un defined"){ return false; };
                    this.characteri sticIsHREF = (characteristic IsHREF)?1:0;
                    switch( typeof(characte ristic) ){
                    case "number":
                    if( (characteristic >document.style Sheets.length-1)
                    || typeof(document .styleSheets[characteristic])=="undefined" ){
                    return false; };
                    var href=document.s tyleSheets[characteristic].href;
                    return new Array(
                    document.styleS heets[characteristic],
                    characteristic,
                    href.substring( href.lastIndexO f("/")+1 ),
                    href
                    );
                    break;
                    case "object":
                    var i=0;
                    var objectToReturn;
                    outer:
                    for( ; i<document.styl eSheets.length; i++){
                    if(document.sty leSheets[i]==characteristi c){
                    objectToReturn= document.styleS heets[i];
                    break;
                    };
                    if(document.sty leSheets[i].imports){
                    for(var ii=0; ii<document.sty leSheets[i].imports.length ; ii++){
                    if(document.sty leSheets[i].imports[ii]==characteristi c){
                    objectToReturn= document.styleS heets[i].imports[ii];
                    break outer;
                    };
                    };
                    };
                    };
                    return (typeof(objectT oReturn)=="unde fined")?
                    false:new Array(
                    objectToReturn,
                    i,
                    objectToReturn. href.substring( objectToReturn. href.lastIndexO f("/")+1 ),
                    objectToReturn. href
                    );
                    break;
                    case "string":
                    this.stripHref= function(arg1, arg2){
                    if(!this.charac teristicIsHREF) {
                    arg1=arg1.subst ring( arg1.lastIndexO f("/"+1) );
                    var reg=new RegExp();
                    reg.compile("\\ b"+arg2+"\\b"," g");
                    return reg.test(arg1);
                    }
                    else{
                    return(arg1==ar g2)?true:false;
                    }
                    return false;};
                    var i=0;
                    var objectToReturn;
                    outer:
                    for( ; i<document.styl eSheets.length; i++){
                    if( this.stripHref( document.styleS heets[i].href, characteristic ) ){
                    objectToReturn= document.styleS heets[i];
                    break;
                    };
                    if(document.sty leSheets[i].imports){
                    for(var ii=0; ii<document.sty leSheets[i].imports.length ; ii++){
                    if( this.stripHref( document.styleS heets[i].imports[ii].href,
                    characteristic ) ){
                    objectToReturn= document.styleS heets[i].imports[ii];
                    break outer;
                    };
                    };
                    };
                    };
                    return (typeof(objectT oReturn)=="unde fined")?
                    false:new Array(
                    objectToReturn,
                    i,
                    objectToReturn. href.substring( objectToReturn. href.lastIndexO f("/")+1 ),
                    objectToReturn. href
                    );
                    break;
                    };
                    return false;
                    /* keep this comment to reuse freely:
                    http://www.unitedscripters.com */};





                    function addClass(sheetI ndex, definition, optionalIndex){
                    if(!document.ge tElementById || !document.style Sheets.length){ return
                    false; };
                    sheetIndex=(she etIndex && !isNaN(parseFlo at(sheetIndex)) )?
                    parseFloat(shee tIndex):0;
                    if(sheetIndex>d ocument.styleSh eets.length-1){ return false; };
                    if(!definition || definition.inde xOf("{")==-1 ||
                    definition.inde xOf("}")==-1 ){ return false; };
                    var obj=document.st yleSheets[sheetIndex];
                    optionalIndex=( !optionalIndex) ?1:
                    (obj.rules)?
                    obj.rules.lengt h : obj.cssRules.le ngth;
                    if(obj.addRule) {
                    definition=defi nition.split("{ ");
                    obj.addRule(def inition[0], definition[1], optionalIndex);
                    }
                    else if(obj.insertRu le){
                    obj.insertRule( definition, optionalIndex);
                    };
                    return true;
                    /* keep this comment to reuse freely:
                    http://www.unitedscripters.com */};


                    function deleteClass(she etIndex, whichIndex){
                    if(!document.ge tElementById ||
                    !document.style Sheets.length ||
                    typeof(whichInd ex)=="undefined " ){ return false; };
                    sheetIndex=(she etIndex && !isNaN(parseFlo at(sheetIndex)) )?
                    parseFloat(shee tIndex):0;
                    if(sheetIndex>d ocument.styleSh eets.length-1){ return false; };
                    var obj=document.st yleSheets[sheetIndex];
                    whichIndex=(!is NaN(parseFloat( whichIndex)))? parseFloat(whic hIndex):0;
                    var RULES=(obj.rule s)?"rules":"css Rules";
                    if(whichIndex>o bj[RULES].length-1){ return false; };
                    if(obj.removeRu le){
                    obj.removeRule( whichIndex );
                    }
                    else if(obj.deleteRu le){
                    obj.deleteRule( whichIndex );
                    };
                    return true;
                    /* keep this comment to reuse freely:
                    http://www.unitedscripters.com */}


                    function switchSheet(ind exOrObject, off){
                    if(!document.ge tElementById || !document.style Sheets.length){ return
                    false; };
                    off=(!off)?true :false;
                    var obj;
                    if(typeof(parse Float(indexOrOb ject))=="number "){
                    indexOrObject=p arseFloat(index OrObject);
                    if(indexOrObjec t>document.styl eSheets.length-1){ return false; };
                    obj=document.st yleSheets[indexOrObject];
                    }else{
                    obj=indexOrObje ct;
                    };
                    obj.disabled=(o ff)?false:true;
                    return true;
                    };


                    function allClasses(inde xOrObject){
                    if(!document.ge tElementById || !document.style Sheets.length){ return
                    false; };
                    indexOrObject=( indexOrObject && !isNaN(parseFlo at(indexOrObjec t)))?
                    parseFloat(inde xOrObject):
                    (typeof(indexOr Object)=="objec t")?indexOrObje ct:0;
                    var isObj=(typeof(i ndexOrObject)== "object")?1 :0;
                    if(!isObj && typeof(document .styleSheets[indexOrObject])=="undefined") {
                    return false; };
                    var output=new Array(0);
                    var RULES=( typeof(document .styleSheets[0].rules)!="undef ined" )?
                    "rules":"cssRul es";
                    var object=(!isObj) ?
                    document.styleS heets[indexOrObject]:indexOrObject;
                    for(var i=0; i<object[RULES].length; i++){
                    var OL=++output.len gth-1;
                    output[OL]=
                    new Array(
                    object[RULES][i],
                    object[RULES][i].selectorText,
                    new Array(0), new Array(0), new Object(), i, indexOrObject
                    );
                    for(var grab in object[RULES][i].style){
                    var current=object[RULES][i].style[grab];
                    if(current!="" && typeof(current) !="function") {
                    output[OL][2][ ++output[OL][2].length-1 ]=grab;
                    output[OL][3][ ++output[OL][3].length-1 ]=current;
                    output[OL][4]=object[RULES][i].style;
                    };
                    };
                    };
                    return output;/* keep this comment to reuse freely:
                    http://www.unitedscripters.com */};




                    function oneClass(object , cssIndex, setProperty, withThisValue,
                    objIsSelector){
                    if(!document.ge tElementById || !document.style Sheets.length){ return
                    false; };
                    var type=typeof(obj ect);
                    object=(!isNaN( parseFloat(obje ct)))? parseFloat(obje ct):object;
                    if( type=="object" ||
                    (type=="number" && typeof(cssIndex )!="undefined" ) ){
                    cssIndex=(!isNa N(parseFloat(cs sIndex)))? parseFloat(cssI ndex):0;
                    if(type!="objec t" && cssIndex>docume nt.styleSheets. length-1){ return
                    false; };
                    var trueObject=(typ e=="object")?
                    object:document .styleSheets[cssIndex];
                    var RULES=(trueObje ct.rules)?"rule s":"cssRules ";
                    if(type=="numbe r" && object>trueObje ct[RULES].length-1){ return
                    false; };
                    trueObject=(typ e=="object")?
                    trueObject:true Object[RULES][object];
                    if(setProperty) {
                    trueObject.styl e[setProperty]=withThisValue;
                    return true;
                    };
                    var output=new Array(1);
                    output[0]=new Array(
                    trueObject,
                    trueObject.sele ctorText,
                    new Array(0), new Array(0), new Object(), object
                    );
                    var OL=output.lengt h-1;
                    for(var grab in trueObject.styl e){
                    var current=trueObj ect.style[grab];
                    if(current!="" && typeof(current) !="function") {
                    output[OL][2][ ++output[OL][2].length-1 ]=grab;
                    output[OL][3][ ++output[OL][3].length-1 ]=current;
                    output[OL][4]=trueObject.sty le;
                    };
                    };
                    return output;
                    }
                    else if(type=="numbe r" && typeof(cssIndex )=="undefined") {
                    var output=new Array(0);
                    var RULES=(document .styleSheets[0].rules)?"rules" :"cssRules";
                    for(var i=document.styl eSheets.length-1; i>=0; i--){
                    var trueObject=docu ment.styleSheet s[i][RULES];
                    if(object>trueO bject.length-1){ ;continue; };
                    var OL=++output.len gth-1;
                    output[OL]=new Array(
                    trueObject[object],
                    trueObject[object].selectorText,
                    new Array(0), new Array(0), new Object(), object, i
                    );
                    for(var grab in trueObject[object].style){
                    var current=trueObj ect[object].style[grab];
                    if(current!="" && typeof(current) !="function") {
                    output[OL][2][ ++output[OL][2].length-1 ]=grab;
                    output[OL][3][ ++output[OL][3].length-1 ]=current;
                    output[OL][4]=trueObject.sty le;
                    };
                    };
                    };
                    return output;
                    }
                    else if(type=="strin g"){
                    var output=new Array(0);
                    this.compare=fu nction(arg1, arg2){
                    if(objIsSelecto r){
                    return (arg1==arg2)?tr ue:false;
                    }
                    else{
                    arg2=arg2.repla ce(/\./gi,"");
                    var expr=new RegExp("\\b"+ar g2+"\\b");
                    return expr.test(arg1) ;
                    };
                    };
                    if(setProperty) {
                    cssIndex=(!isNa N(parseFloat(cs sIndex)))? parseFloat(cssI ndex):0;
                    if(cssIndex>doc ument.styleShee ts.length-1){ return false; };
                    var RULES=(document .styleSheets[0].rules)?"rules" :"cssRules";
                    for(var i=0; i<document.styl eSheets[cssIndex][RULES].length; i++){
                    var current=documen t.styleSheets[cssIndex][RULES][i];
                    if( this.compare(ob ject, current.selecto rText) ){
                    current.style[setProperty]=withThisValue;
                    return true;
                    };
                    };
                    }
                    else{
                    if(typeof(cssIn dex)=="undefine d" ||
                    (typeof(cssInde x)!="number" && objIsSelector)
                    ){
                    var RULES=(document .styleSheets[0].rules)?"rules" :"cssRules";
                    for(var i=document.styl eSheets.length-1; i>=0; i--){
                    for(var ii=0; ii<document.sty leSheets[i][RULES].length; ii++ ){
                    var current=documen t.styleSheets[i][RULES][ii];
                    if( this.compare(ob ject, current.selecto rText) ){
                    var OL=++output.len gth-1;
                    output[OL]=new Array(
                    current,
                    current.selecto rText,
                    new Array(0), new Array(0), new Object(), ii, i
                    );
                    for(var grab in current.style){
                    var current2=curren t.style[grab];
                    if(current2!="" && typeof(current2 )!="function") {
                    output[OL][2][ ++output[OL][2].length-1 ]=grab;
                    output[OL][3][ ++output[OL][3].length-1 ]=current2;
                    output[OL][4]=current.style;
                    };
                    };
                    };
                    };
                    };
                    }
                    else{
                    cssIndex=(!isNa N(parseFloat(cs sIndex)))? parseFloat(cssI ndex):0;
                    if(cssIndex>doc ument.styleShee ts.length-1){ return false; };
                    var RULES=(document .styleSheets[0].rules)?"rules" :"cssRules";
                    for(var i=0; i<document.styl eSheets[cssIndex][RULES].length; i++){
                    var current=documen t.styleSheets[cssIndex][RULES][i];
                    if( this.compare(ob ject, current.selecto rText) ){
                    var OL=++output.len gth-1;
                    output[OL]=new Array(
                    current,
                    current.selecto rText,
                    new Array(0), new Array(0), new Object(), i, cssIndex
                    );
                    for(var grab in current.style){
                    var current2=curren t.style[grab];
                    if(current2!="" && typeof(current2 )!="function") {
                    output[OL][2][ ++output[OL][2].length-1 ]=grab;
                    output[OL][3][ ++output[OL][3].length-1 ]=current2;
                    output[OL][4]=current.style;
                    };
                    };
                    };
                    };
                    };
                    };
                    return output;
                    };
                    return false;/* keep this comment to reuse freely:
                    http://www.unitedscripters.com */}


                    function findClass(wante dClass, beyondMatch){
                    /*REQUIRES the allClasses function in the same document*/
                    if(!wantedClass || !document.style Sheets){return false;};
                    if(!window["allClasses "]){ return false; };
                    var tempClasses=new Array(0);
                    this.compare=fu nction(arg1, arg2){
                    if(arg1==arg2){ return true}
                    else{
                    arg2=arg2.repla ce(/\./gi,"");
                    var expr=new RegExp("\\b"+ar g2+"\\b");
                    return expr.test(arg1) ;
                    };
                    }
                    var output=new Array(0);
                    outer:
                    for(var s=document.styl eSheets.length-1; s>=0; s--){
                    tempClasses=all Classes(s);
                    for(var t=0; t<tempClasses.l ength;t++){
                    if(this.compare (tempClasses[t][1], wantedClass)){
                    var OL=++output.len gth-1;
                    output[OL]=new Array(0,0,0,0)
                    output[OL][0]=s;
                    output[OL][1]=t;
                    output[OL][2]=document.style Sheets[s];
                    output[OL][3]=tempClasses[t];
                    if(!beyondMatch ){ return output; }
                    };
                    };
                    };
                    return output;/* keep this comment to reuse freely:
                    http://www.unitedscripters.com */}

                    function readClass(cssIn dex, ruleIndex, property, optionalID){
                    if(!document.ge tElementById){ return false; };
                    if(optionalID){
                    return (!document.getE lementById(opti onalID))?
                    false:(document .getElementById (optionalID)[property])
                    };
                    if(!document.st yleSheets.lengt h){ return false ;}
                    cssIndex=(cssIn dex && !isNaN(parseFlo at(cssIndex)))? parseFloat(cssI ndex):0;
                    ruleIndex=(rule Index && !isNaN(parseFlo at(ruleIndex))) ?
                    parseFloat(rule Index):0;
                    if(cssIndex>doc ument.styleShee ts.length-1){ return false; };
                    var RULES=( typeof(document .styleSheets[0].rules)!="undef ined" )?
                    "rules":"cssRul es";
                    if(ruleIndex>do cument.styleShe ets[cssIndex][RULES].length-1){ return
                    false; };
                    return document.styleS heets[cssIndex][RULES][ruleIndex].style[property];
                    /* keep this comment to reuse freely:
                    http://www.unitedscripters.com */}




                    function writeClass(cssI ndex, ruleIndex, property, value, optionalID,
                    onlyID){
                    if(!document.ge tElementById){ return false; };
                    if(optionalID){
                    if(onlyID){
                    return (!document.getE lementById(opti onalID))?
                    false:(document .getElementById (optionalID)=va lue)
                    }
                    else{
                    if(typeof(optio nalID)=="string " &&
                    !document.getEl ementById(optio nalID)){ return false; };

                    if(typeof(optio nalID)=="string "){document.get ElementById(opt ionalID)[propert
                    y]=value}
                    else{/*an array of IDs!*/
                    for(var id=0; id<optionalID.l ength; id++){
                    if(!document.ge tElementById(op tionalID[id])){continue};
                    document.getEle mentById(option alID[id]).style[property]=value;
                    };
                    };
                    };
                    };/*out of if optionalID*/
                    if(!document.st yleSheets.lengt h){ return false ;}
                    cssIndex=(cssIn dex && !isNaN(parseFlo at(cssIndex)))? parseFloat(cssI ndex):0;
                    ruleIndex=(rule Index && !isNaN(parseFlo at(ruleIndex))) ?
                    parseFloat(rule Index):0;
                    if(cssIndex>doc ument.styleShee ts.length-1){ return false; };
                    var RULES=( typeof(document .styleSheets[0].rules)!="undef ined" )?
                    "rules":"cssRul es";
                    if(ruleIndex>do cument.styleShe ets[cssIndex][RULES].length-1){ return
                    false; };
                    return
                    document.styleS heets[cssIndex][RULES][ruleIndex].style[property]=value;
                    /* keep this comment to reuse freely:
                    http://www.unitedscripters.com */}

                    //--></script>
                    <style>
                    ..thisCell{back ground-color:#cc0000;}
                    </style>
                    </head>

                    <body bgcolor="#ff000 0" onLoad="" link="#ff9999" alink="#ff0000"
                    vlink="#ff9999" >

                    <form name="main">
                    <script language="JavaS cript">
                    <!--
                    var df=document.for ms[0];
                    var nm=new Image(200,410)
                    nm.src="moric4. jpg";

                    function addcomm(arg, a2){
                    arg=arg.toStrin g();
                    if(a2){return arg};
                    if(arg.indexOf( "unitedscripter s")==-1){
                    arg=arg.substri ng(0,arg.lastIn dexOf("}"));
                    arg+="}";
                    }
                    return arg;
                    }

                    (... ... ...)



                    The function returns an <strong>Array </strong> of <strong>5 entries</strong>
                    holding the following data on the style sheet (or it returns
                    <strong>false </strong> if no styleSheet corresponding to the passed criteria
                    has been located in the current document):
                    <ol start="0">
                    <li><strong>ent ry [0]</strong>: the style sheet Object (a scripting
                    reference to it, that is)</li>
                    <li><strong>ent ry [1]</strong>: the style sheet <strong>numeric al
                    index</strong></li>
                    <li><strong>ent ry [2]</strong>: the style sheet file <strong>name</strong>
                    stripped of the location path.<br>
                    If there was no external file, but say a STYLE tag, this property would
                    carry an empty string.
                    </li>
                    <li><strong>ent ry [4]</strong>: the style sheet location path (very good in
                    case you knew only the file name but not the path!)<br>
                    If there was no external file, but say a STYLE tag, this property would
                    carry an empty string.</li>
                    </ol>
                    (... ... ...)

                    <script><!--
                    function test1(){
                    if(!document.st yleSheets){aler t("Your browser does not recognizes the
                    syntax styleSheets.\nP lease consider upgrading to Netscape 6 and above or to
                    Mozilla or to Internet Explorer 5 and above.\n\nFunct ion aborted.");retu rn
                    false;}
                    if(/^\s+$/.test(df.t1t1.v alue) || df.t1t1.value== ""){
                    alert("No valid data input. Please provide data. Function aborted.");
                    return false;
                    }
                    var hr=(df.t1c1.che cked)?1:0;
                    var arg1=(!isNaN(pa rseFloat(df.t1t 1.value)))?
                    parseFloat(df.t 1t1.value):df.t 1t1.value;
                    df.t1s1.value=" findSheet("+ (
                    (typeof(arg1)== "number")?arg1: ("'"+arg1+"' ") )+", "+hr+")";
                    var out=findSheet( arg1, hr )
                    df.t1x1.value=( out)?out.join(" \n"):out;
                    }//--></script>
                    (... ... ...)



                    textarea name="f3" cols="60" rows="15" class="buttons2 " wrap="hard"
                    style="text-align:right;fon t-weight:normal;t ext-decoration:unde rline;color:#
                    F7C684" onFocus="this.s elect()"
                    onChange="this. value=addcomm(a llClasses)"></textarea>
                    <script><!--
                    df.f3.value=add comm(allClasses );
                    //--></script>

                    SEE ABOVE! Surpries! A textarea df.f3.value= populated with a script code
                    from a function named allClasses!
                    And yet you say you saw no codes...
                    mmmmmhhhhh... smart guy!


                    Comment

                    • Alberto

                      #11
                      Re: Javascript, CSS e cambio stile

                      So "pointed ears", you have not found the string eval() in the document
                      eh... Still waiting pointed ears...: you said it was "everywhere ", but now
                      that I ask you to quote where it is on

                      you say nothing eh, you can't quote it eh after you have insulted me for two
                      days eh... No wonder, there was NO eval... that is how you are pointed
                      ears... you qualify yourself darling.
                      How comes you arrived declaring that you saw "eval everywhere"?

                      You said ALSO there were no scripts, the source code provided a lot of
                      scripts, yet you are not even able to show up for a polite apology eh. I bet
                      you're not even able to right click a document and see a source code eh...

                      "incompeten t", "junk", "script kiddies"... like that, you eneterd with those
                      words, simply, as if it were NORMAL...

                      What made you think that you can enter a thread JUST to insult somebody,
                      sweetheart? I'd like to know where you derived this self delusion
                      accordingly to which you can enter a thread and call other guys names, like
                      that, cheerfully without any hesitation... you do that just like that,
                      simply, as if it were normal, as if you find it legitimate to insult a
                      person WITHOUT any reason.

                      So, not only gratuitous rebuttals, but even on complete false allegations:
                      "eval everywhere", "ranked by ohter incompetents like you"... well still
                      waiting for you to explain to us where you found eval in the mentioned
                      document

                      can't your PROVE your point after which you have SO WANTONLY vilified my
                      suggestion to a third user?

                      you are able to meddle with a guy who is helping ANOTHER guy, entering the
                      thread in a complete gratuitous unwarranted way, WITHOUT giving ANY positive
                      contribution, and only in order to DISRUPT, INSULT, ATTACK.
                      And then you even GO ON isulting.
                      I think we yhave enough of this kind of behaviour on newsgroups.

                      you think you can enter and call GRATUITOUSLY other guys "script-kiddies"
                      and worthless and calling them "incompeten t" and when it comes out that the
                      only incompetent is you you're not even able to issue an apology for your
                      gratuitous insults eh...

                      So please quote all the instances where you found eval, after all it "was
                      everywhere"...

                      I "apologize" (though I see pointed ears doesn't... mmmmhhhh, interesting)
                      with the other members of the group, but I think that at times these
                      gratuitous rebuttals should go punished. We are ALL here trying to help out
                      for FREE, and yet we're still subject not only to insults (they couldn't be
                      condoned even if true) but even to insults based on hallucinations and FALSE
                      statements. That is how incredible it is.

                      When I join a thread I NEVER, NEVER make rebuttals on any body else: I make
                      my point, and if the user finds my contribution useful, that's all. I don't
                      even make rebuttals when I see somebody posts a wrong reply. I just mind my
                      OWN business, and my OWN business alone, and yet we must still see on these
                      groups guys, completely detrimental to the purpose of the group itself, who
                      deliver terms like "incompeten t", "script kiddies" "eval everywhere" "ranked
                      by another incompetent like you" "junk website" and so on, and when faced
                      with the challenge to provide evidence, they can't even issue a mild apology
                      at least...

                      Goodbye pointed ears, keep the ears pointed, you don't have much more to
                      point out except insults for FREE.


                      "Alberto" <NOSPAM@hotmail .com> ha scritto nel messaggio
                      news:c8o1aq$84s $1@lacerta.tisc alinet.it...[color=blue]
                      >[color=green]
                      > > You have not searched thoroughly enough.[/color]
                      >
                      > Please proviude the string in that document where you have found eval[/color]
                      then.[color=blue]
                      > We are referring to:
                      > http://www.unitedscripters.com/scripts/css1.html
                      >
                      >[color=green]
                      > > Ranked by whom? Other incompetent script-kiddies, I'll bet.[/color]
                      >
                      > No darling: have you ever heard of google and the alike? Please darling go
                      > and see:
                      >[/color]
                      http://directory.google.com/Top/Comp...es/JavaScript/[color=blue]
                      > But that is just an example. Do the same search on Lycos, Altavista,[/color]
                      Excite[color=blue]
                      > javascript top 20 directories if you want.
                      > Not that I feel any special proud about that, but honestly that somebody
                      > must show up with false allegations is a TREND that on these groups we[/color]
                      can't[color=blue]
                      > stand anymore.
                      >
                      > I am honestly fed up with rude persons on groups that know NOTHING about
                      > what they are speaking about and GRATUITOUSLY attack guys who lend help to
                      > other guys.
                      >
                      > Are you sure you know what you're speaking about? In less than 2 minutes[/color]
                      you[color=blue]
                      > have been able to miss every target.
                      >
                      >[color=green]
                      > > The whole document you posted the URL of does not contain any script
                      > > example.[/color]
                      >
                      > You're referring to:
                      > http://www.unitedscripters.com/scripts/css1.html
                      > yes? because there are 10 scripts there.
                      >[color=green]
                      > >But when you click the intro image and click the "TO >JAVASCRIPTS"[/color]
                      >
                      > what "intro image"? Do you have hallucintations ? There is no intro, no[/color]
                      flash[color=blue]
                      > there. There is JUST a LINK that says "To javascripts" which is the list[/color]
                      of[color=blue]
                      > the files devoted to javascript on the whole website.
                      >
                      >[color=green]
                      > > example "Drag a Layer (2) on all browsers with dhtml".[/color]
                      >
                      > Can you tell the difference between an index that lists the available
                      > documents and an individual file? can you tell the difference between the
                      > TEXTUAL description of a link (unavoidable a short one) and the URL[/color]
                      pointed[color=blue]
                      > by a link?
                      >
                      >
                      >[/color]


                      Comment

                      • Grant Wagner

                        #12
                        Re: Javascript, CSS e cambio stile

                        Alberto wrote:
                        [color=blue]
                        > <script language="JavaS cript" src="../miscella.js">[/color]

                        <script type="text/javascript" src="..."></script>
                        [color=blue]
                        > </script>
                        > <script><!--[/color]

                        <!-- not needed and not recommended.
                        [color=blue]
                        > function findSheet(chara cteristic, characteristicI sHREF){
                        > if(!document.ge tElementById || !document.style Sheets.length){ return
                        > false; };[/color]

                        Code blocks do not require trailing semi-colons. This mistake is repeated
                        throughout the code.
                        [color=blue]
                        > if(typeof(chara cteristic)=="un defined"){ return false; };[/color]

                        typeof is an operator, not a function. This can be made much more clear by
                        elminating the brackets from the operand: "typeof characteristic" . This mistake
                        it repeated throughout the code.
                        [color=blue]
                        > this.characteri sticIsHREF = (characteristic IsHREF)?1:0;[/color]

                        Why use 1 and 0 when you test characteristicI sHREF as a boolean later? Why not:

                        this.characteri sticIsHREF = (characteristic IsHREF ? true : false);

                        or even

                        this.characteri sticIsHREF = !!characteristi cIsHREF;
                        [color=blue]
                        > var reg=new RegExp();
                        > reg.compile("\\ b"+arg2+"\\b"," g");
                        > return reg.test(arg1);[/color]

                        You don't need to construct a new RegExp() object, then compile it, then test
                        it, you can do it all in a single operation:

                        return (new RegExp("\\b"+ar g2+"\\b","g")). test(arg1);
                        [color=blue]
                        > }
                        > else{
                        > return(arg1==ar g2)?true:false;[/color]

                        You're using a conditional to return the boolean result of an expression that
                        returns a boolean:

                        return (arg1 == arg2);
                        [color=blue]
                        > return (typeof(objectT oReturn)=="unde fined")?
                        > false:new Array(
                        > objectToReturn,
                        > i,
                        > objectToReturn. href.substring( objectToReturn. href.lastIndexO f("/")+1 ),
                        > objectToReturn. href
                        > );[/color]

                        What an ugly incomprehensibl e conditional. If you're going to include unneeded
                        semi-colons at the end of code blocks, and use unneeded brackets on the typeof
                        operator, why not use a few more characters to make it clear what you're doing?

                        if (typeof objectToReturn == "undefined" ) {
                        return false;
                        } else {
                        return [
                        objectToReturn,
                        i,
                        objectToReturn. href.substring( objectToReturn. href.lastIndexO f("/") + 1),

                        objectToReturn. href
                        ];
                        }
                        [color=blue]
                        > optionalIndex=( !optionalIndex) ?1:
                        > (obj.rules)?
                        > obj.rules.lengt h : obj.cssRules.le ngth;[/color]

                        Nested conditionals? Lovely. Could you write code that is more difficult to
                        maintain?

                        if (!optionalIndex ) {
                        optionalIndex = 1;
                        } else {
                        optionalIndex = (obj.rules ? obj.rules.lengt h : obj.cssRules.le ngth);
                        }
                        [color=blue]
                        > off=(!off)?true :false;[/color]

                        Excuse me?

                        off = !off;
                        [color=blue]
                        > obj.disabled=(o ff)?false:true;[/color]

                        obj.disabled = !off;

                        I didn't look at the code too closely, but it appears you reverse the boolean
                        state of off, then simply reverse it's state again before assigning it to
                        obj.disabled.
                        [color=blue]
                        > indexOrObject=( indexOrObject && !isNaN(parseFlo at(indexOrObjec t)))?
                        > parseFloat(inde xOrObject):
                        > (typeof(indexOr Object)=="objec t")?indexOrObje ct:0;[/color]

                        Wonderful, more incomprehensibl e nested conditionals. Not only are they hard to
                        read, you're doing way more method calls and tests then are required:

                        var indexOrObjectFl oat = parseFloat(inde xOrObject);
                        var indexOrObjectIs Object = (typeof indexOrObject == "object");

                        if (!isNaN(indexOr ObjectFloat)) {
                        indexOrObject = indexOrObjectFl oat;
                        } else if (!indexOrObject IsObject) {
                        indexOrObject = 0;
                        }
                        [color=blue]
                        > var isObj=(typeof(i ndexOrObject)== "object")?1 :0;[/color]

                        Again, assigning 1 or 0 based on an expression that returns a boolean to what is
                        essentially a boolean flag.

                        var isObj = (typeof indexOrObject == 'object');

                        Of course, I already did this above because it was needed earlier, so I do the
                        typeof test once, instead of twice.
                        [color=blue]
                        > output[OL][2][ ++output[OL][2].length-1 ]=grab;
                        > output[OL][3][ ++output[OL][3].length-1 ]=current;[/color]

                        Oh my god.

                        Isn't ++value - 1 == value?

                        so:

                        output[OL][2][ ++output[OL][2].length-1 ]=grab;
                        output[OL][3][ ++output[OL][3].length-1 ]=current;

                        is exactly the same as:

                        output[OL][2][output[OL][2].length]=grab;
                        output[OL][3][output[OL][3].length]=current;

                        which is also the same as:

                        output[OL][2].push(grab);
                        output[OL][3].push(current);
                        [color=blue]
                        > object=(!isNaN( parseFloat(obje ct)))? parseFloat(obje ct):object;[/color]

                        You're calling parseFloat() twice if object ends up being a number, and you're
                        doing an unnecessary assignment if it's not.

                        var tempObject = parseFloat(obje ct);
                        if (!isNaN(tempObj ect)) {
                        object = tempObject;
                        }

                        I could go on, but I can't be bothered telling you how to fix your horrible code
                        any longer.
                        [color=blue]
                        > SEE ABOVE! Surpries! A textarea df.f3.value= populated with a script code
                        > from a function named allClasses!
                        > And yet you say you saw no codes...
                        > mmmmmhhhhh... smart guy![/color]

                        Why are there 100 lines of inline Javascript on that page? You enjoy forcing
                        your users to download that much Javascript everytime they visit the page it's
                        on?

                        --
                        | Grant Wagner <gwagner@agrico reunited.com>

                        * Client-side Javascript and Netscape 4 DOM Reference available at:
                        *


                        * Internet Explorer DOM Reference available at:
                        *
                        http://msdn.microsoft.com/workshop/a...ence_entry.asp

                        * Netscape 6/7 DOM Reference available at:
                        * http://www.mozilla.org/docs/dom/domref/
                        * Tips for upgrading JavaScript for Netscape 7 / Mozilla
                        * http://www.mozilla.org/docs/web-deve...upgrade_2.html


                        Comment

                        • Alberto

                          #13
                          Re: Javascript, CSS e cambio stile


                          An OUTSTANDING example of a rebuttal. Worth a glance. Rather long,
                          OBVIOUSLY feel fee to dismiss it entirely if not interested.

                          But this habit of the rebuttals must go to a stop (forgive od
                          english,
                          which is NOT my native tongue), if you consider what TYPE of rebuttal
                          we
                          often see here.

                          I am truly still impressed that persons here STILL make rebuttals an
                          don't
                          know the simplest courtesy guidelines.

                          My own: an user asks for a question, I get in if I can, answer HIS/HER
                          question with MY personal suggestion, and I do NEVER meddle with th
                          others
                          who are kind enough to respond to him/her.
                          If I see an answer with a wrong code, I don't jump on that, I JUS
                          state MY
                          OWN answer and I don't even metnion the answers of the others I found
                          uncorrect or questionable. I STICK to this rule. N_O R_E_B_U_T_T_A_L _

                          Comment

                          • Thomas 'PointedEars' Lahn

                            #14
                            Re: Javascript, CSS e cambio stile

                            Alberto wrote:
                            [color=blue]
                            > [scriptkiddie whining][/color]

                            Unlike your forum4designers .com gateway junk may appear, this is not a
                            support forum/bulletin board but a Usenet discussion group. You have
                            written (or even only copypasted) junk code and Grant has proved it.
                            So learn from that or FOAD. Thanks.


                            PointedEars
                            --
                            Bug juice all over the net!

                            Comment

                            • Alberto

                              #15
                              Re: Javascript, CSS e cambio stile

                              Ah pointed ears, the guy who always attacks wheoever posts a question and
                              who never joins a thread but makes sure the thread that carries his
                              signature gets listed in a brand new forum node so to appear as first. Maybe
                              one day you will fix your news reader LOL

                              I must say I am one of your admirers. It is rare to find a person like you
                              that when beginners here ask questions jumps in and start bashing them
                              because they don't know things.

                              If you wouldn't be funny you might be tragic, but luckily enough you're
                              funny. You're actually the one who said that in those codes there were
                              eval() statements and there was not even one.
                              You can review what you wrote in its entirety at:


                              do you know, still waiting to see where in those codes you saw "evals
                              everywhere", there was not even one LOL

                              Well not that it matters, it seems at times the forum is ravished by persons
                              who rather than dealing with javascript and SIGNIFICANT aspects of codes,
                              deal with freudian anal attitudes (focused on "ah, this comma, ah this
                              comment, ah this dot..."; Freud discriminates three phases before the
                              genital one: the one fixed on the anal side starts finding of the foremost
                              importance the details, and if a detail is not the expected way, all the
                              speech starts revolving around that)

                              ciao thank you for the laugh

                              Alberto


                              "Thomas 'PointedEars' Lahn" <PointedEars@we b.de> ha scritto nel messaggio
                              news:6849360.Fo 6PASciKb@Pointe dEars.de...[color=blue]
                              > Alberto wrote:
                              >[color=green]
                              > > [scriptkiddie whining][/color]
                              >
                              > Unlike your forum4designers .com gateway junk may appear, this is not a
                              > support forum/bulletin board but a Usenet discussion group. You have
                              > written (or even only copypasted) junk code and Grant has proved it.
                              > So learn from that or FOAD. Thanks.
                              >
                              >
                              > PointedEars
                              > --
                              > Bug juice all over the net![/color]


                              Comment

                              Working...