java Script Problem

  • Wenn man auf eine Link klkct soll das entpsrechned html Teil geöffnet werden.Aber es öffnet sich bei jedem mlink immer das gleiche.Das ist mein Html Code:


    <script>
    function winopen(){
    window.open("Bilder/apu.html", "newWindow", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=300,height=300")
    }
    </script>


    <a href="javascript:winopen()">Newsarchiv</a>
    <br>
    <script>
    function winopen(){
    window.open("Bilder/manjula.html", "newWindow", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=300,height=300")
    }
    </script>


    <a href="javascript:winopen()">Grab pics von Manjula</a>
    <br>
    <script>
    function winopen(){
    window.open("Bilder/beide.html", "newWindow", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=300,height=300")
    }
    </script>


    <a href="javascript:winopen()">Grab pics von Beiden</a>


    <img src="http://www.simpsonsline.de/apu/temp/sig2.gif" border=0>


    Nur für dich mit neuem Layout
    <a href="http://www.simpsonsline.de/apu" target="_blank">http://www.simpsonsline.de/apu</a>
    &nbsp;

  • Du muss entweder für jeden Link ne eigene Funktion definieren oder die url als parameter übergeben, das ist komfortabler.
    geht so:


    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function winopen(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=1, width=300, height=300, left = 170, top = 200');");
    }
    // End -->
    </script>


    <a href="javascript:winopen('Bilder/apu.shtml')">Link</a>



    <b><a href="lyricszone.de" target="_blank">lyricszone.de</a></b> &nbsp;

    :king: live long and prosper :king:
    [Color="#E50000"]A[/Color][Color="#E52700"]l[/Color][Color="#E54E00"]w[/Color][Color="#E57600"]a[/Color][Color="#E59D00"]y[/Color][Color="#E5C400"]s[/Color][Color="#DEE500"] [/Color][Color="#B7E500"]a[/Color][Color="#90E500"] [/Color][Color="#68E500"]p[/Color][Color="#41E500"]l[/Color][Color="#1AE500"]e[/Color][Color="#00E50D"]a[/Color][Color="#00E534"]s[/Color][Color="#00E55B"]u[/Color][Color="#00E583"]r[/Color][Color="#00E5AA"]e[/Color][Color="#00E5D1"] [/Color][Color="#00D1E5"]t[/Color][Color="#00AAE5"]o[/Color][Color="#0083E5"] [/Color][Color="#005BE5"]m[/Color][Color="#0034E5"]e[/Color][Color="#000DE5"]e[/Color][Color="#1A00E5"]t[/Color][Color="#4100E5"] [/Color][Color="#6800E5"]a[/Color][Color="#9000E5"] [/Color][Color="#B700E5"]j[/Color][Color="#DE00E5"]e[/Color][Color="#E500C4"]d[/Color][Color="#E5009D"]i[/Color][Color="#E50076"].[/Color]

  • Du kannst deinen Quelltext aber auch so lassen, aber mit einer kleinen Veränderung:


    <script>
    function winopenA(){
    window.open("Bilder/apu.html", "newWindow", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=300,height=300")
    }
    </script>


    <a href="javascript:winopenA()">Newsarchiv</a>
    <br>
    <script>
    function winopenB(){
    window.open("Bilder/manjula.html", "newWindow", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=300,height=300")
    }
    </script>


    <a href="javascript:winopenB()">Grab pics von Manjula</a>
    <br>
    <script>
    function winopenC(){
    window.open("Bilder/beide.html", "newWindow", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=300,height=300")
    }
    </script>


    <a href="javascript:winopenC()">Grab pics von Beiden</a>
    <a href="http://milhouse.simpsons-area.de" target="_blank">http://milhouse.simpsons-area.de</a> -~- Fallout Boy -~- <a href="http://milhouse.simpsons-area.de" target="_blank">http://milhouse.simpsons-area.de</a> &nbsp;

  • Alex : Hab ich doch schon gesagt.


    EDIT: Gut gemacht, gut gemacht Alex :-))
    (nicht spöttisch gemeint) !


    <b><a href="lyricszone.de" target="_blank">lyricszone.de</a></b> &nbsp;

    :king: live long and prosper :king:
    [Color="#E50000"]A[/Color][Color="#E52700"]l[/Color][Color="#E54E00"]w[/Color][Color="#E57600"]a[/Color][Color="#E59D00"]y[/Color][Color="#E5C400"]s[/Color][Color="#DEE500"] [/Color][Color="#B7E500"]a[/Color][Color="#90E500"] [/Color][Color="#68E500"]p[/Color][Color="#41E500"]l[/Color][Color="#1AE500"]e[/Color][Color="#00E50D"]a[/Color][Color="#00E534"]s[/Color][Color="#00E55B"]u[/Color][Color="#00E583"]r[/Color][Color="#00E5AA"]e[/Color][Color="#00E5D1"] [/Color][Color="#00D1E5"]t[/Color][Color="#00AAE5"]o[/Color][Color="#0083E5"] [/Color][Color="#005BE5"]m[/Color][Color="#0034E5"]e[/Color][Color="#000DE5"]e[/Color][Color="#1A00E5"]t[/Color][Color="#4100E5"] [/Color][Color="#6800E5"]a[/Color][Color="#9000E5"] [/Color][Color="#B700E5"]j[/Color][Color="#DE00E5"]e[/Color][Color="#E500C4"]d[/Color][Color="#E5009D"]i[/Color][Color="#E50076"].[/Color]