Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Validazione difficoltosa per javascript

    Perché mi viene dato questo errore da validatore W£c per html 4.01

    Line 16, column 59: document type does not allow element "LINK" here

    <link rel="stylesheet" href="css/stile.css" type="text/css">

    L'ho inserito dopo il tag <body>. E poi un'altra cosa: dentro la pagina c'è javascript fatto così:


    <script type="text/javascript" >

    // Script Source: CodeLifter.com
    // Copyright 2003
    // Do not remove this notice.

    // SETUPS:
    // ===============================

    // Set the horizontal and vertical position for the popup

    PositionX = 100;
    PositionY = 100;

    // Set these value approximately 20 pixels greater than the
    // size of the largest image to be used (needed for Netscape)

    defaultWidth = 300;
    defaultHeight = 300;

    // Set autoclose true to have the window close automatically
    // Set autoclose false to allow multiple popup windows

    var AutoClose = true;

    // Do not edit below this line...
    // ================================
    if (parseInt(navigator.appVersion.charAt(0))>=4){
    var isNN=(navigator.appName=="Netscape")?1:0;
    var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
    var optNN='scrollbars=no,width='+defaultWidth+',height ='+defaultHeight+',left='+PositionX+',top='+Positi onY;
    var optIE='scrollbars=no,width=150,height=100,left='+P ositionX+',top='+PositionY;
    function popImage(imageURL,imageTitle){
    if (isNN){imgWin=window.open('about:blank','',optNN); }
    if (isIE){imgWin=window.open('about:blank','',optIE); }
    with (imgWin.document){
    writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
    writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
    writeln('isNN=(navigator.appName=="Netscape")?1:0; ');writeln('isIE=(navigator.appName.indexOf("Micro soft")!=-1)?1:0;}');
    writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
    writeln('width=100-(document.body.clientWidth-document.images[0].width);');
    writeln('height=100-(document.body.clientHeight-document.images[0].height);');
    writeln('window.resizeTo(width,height);}');writeln ('if (isNN){');
    writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.ima ges["George"].height;}}');
    writeln('function doTitle(){document.title="'+imageTitle+'";}');writ eln('</sc'+'ript>');
    if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
    else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
    writeln('[img]+imageURL+[/img]</body></html>');
    close();
    }}

    </script>
    Il validatore mi da un sacco di errori la in mezzo tipo:
    __________________________________________________ ____
    Line 52, column 45: end tag for element "TITLE" which is not open

    ...'<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writ

    Line 52, column 77: end tag for element "STYLE" which is not open

    ....</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');

    Line 60, column 77: delimiter "'" invalid: only S separators and TAGC allowed here

    ...title="'+imageTitle+'";}');writeln('</sc'+'ript>');
    __________________________________________________ ________

    Non c'è un modo di fargli ignorare il javascript che mi fa un sacco di pasticci nel senso che senza a parte l'errore segnalato in lato va tutto OK e con lui ne trova altri 13.

  2. #2
    comincia col mettere qst
    <link rel="stylesheet" href="css/stile.css" type="text/css">

    tra i tag <head></head>

    :bubu:
    Sayonara...

    kami del tempo / raccogli i miei ricordi / vola distante.

    Rinaldo - RexPlants
    RexPlants il forum delle piante che mangiano

  3. #3
    Fatto, ma permane il grosso problema di altri 13 errori dentro il java !!!

  4. #4
    Utente di HTML.it L'avatar di zoom
    Registrato dal
    Dec 2001
    Messaggi
    1,737
    metti il link tra head...

    e poi quel js non ha senso..
    riscrive il tag body, ci mette un'img e lo chiude..
    praticamente in pagina ti trovi due body
    Chicco Ravaglia per sempre con noi!

  5. #5
    Quel js (preso paro paro da non so più dove) apre una nuova finestra con dentro una foto e la ridimensiona in base alle caratteristiche di questa. A me serve avere una cosa del genere

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.