Jump to content
Sign in to follow this  
Loomy

Feil i HTML-validering pga et JS

Recommended Posts

<script LANGUAGE="JavaScript" TYPE="text/javascript">

<!--

function OneStat_Pageview()

{

    var d=document;

    var sid="171439";

    var CONTENTSECTION="";

    var CUSTOMDATA="";

    var osp_URL=d.URL;

    var osp_Title=d.title;

    var t=new Date();

    var p="http"+(document.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&sid="+sid;

    p+="&url="+escape(osp_URL);

    p+="&ti="+escape(osp_Title);

    p+="&section="+escape(CONTENTSECTION);

    p+="&custom="+escape(CUSTOMDATA);

    p+="&rf="+escape(window.document.referrer);

    p+="&tz="+escape(t.getTimezoneOffset());

    p+="&ch="+escape(t.getHours());

    p+="&js=1";

    p+="&ul="+escape(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage);

    if(typeof(screen)=="object"){

      p+="&sr="+screen.width+"x"+screen.height;p+="&cd="+screen.colorDepth;

      p+="&jo="+(navigator.javaEnabled()?"Yes":"No");

    }

d.write('<a href="http://www.onestat.com/aspx/login.aspx?sid='+sid+'" target=_blank><img id="ONESTAT_TAG" border="0" src="http://stat.onestat.com/stat.aspx?tagver=2&sid='+sid+'" alt="This Site is Tracked by OneStat.com"></a>');

}

 

OneStat_Pageview();

//-->

</SCRIPT>

 

Den røde linjen inneholder feilen (i følge HTML-validatoren i hvert fall)

 

Får følgende feil i valideringen:

Line 168, column 221: end tag for element "A" which is not open (explain...).

...This Site Tracked by OneStat.com"></a>');

 

Noen som kan tipse meg om hvordan jeg fikser dette? Vil gjerne ha en HTML-validert side :cool:

Share this post


Link to post

Du MÅ ikke legge den i en ekstern fil heller. Validatoren reagerer på < og > og disse kan skrives på andre måter for å slippe unna, men koden blir mindre lesbar, og det er bare tull, så ejg er i utgangspunktet enig med Torbjørn.

Måtte bare si det :p

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...