Jump to content
jimfog

Problem With Gchrome

Recommended Posts

I have a problem with the way some links appear in google chrome. The site i am referring to is here:http://www.hellenicastrology.gr/ Go in the footer in the #sitemap. Why the bullets appear in blue? I have set, in css, these links, when visited to be white, the specific rule is found in sitemap.css. While in ff everything is ok, in chrome the bullets are displayed blue-the links are ok though, they are displayed in white. Why do you think that happens?

Share this post


Link to post
Share on other sites

You have this all wrong. List items don't go inside links, the links go inside the list items. The same with the <h3> tags. Put them inside list items. You probably should fix some of the [validation errors] on your site.

Share this post


Link to post
Share on other sites

Many errors, i have to go by them one by one. One question is though, why so many javascript errors, and difficult to pinpoint exactly the root of the problem.

Share this post


Link to post
Share on other sites

Ι am having difficulty understanding why the validation tool output some js syntax as error. For example: The first error that appears is this:Line 45, Column 76: character ";" not allowed in attribute specification list… var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)Here is the whole code:

function MM_preloadImages(){ //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}

The semicolon in the for loop, at the above position is perfectly legitimate. Why that?

Share this post


Link to post
Share on other sites

the html validator is treating js as part of html, which you don't want! you have to use comment tags within the <script> tags to prevent the validator reading the javascript code.

<script type="text/javascript"><!--//function MM_preloadImages(){ //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}} //--></script>

Share this post


Link to post
Share on other sites

I prefer CDATA tags:

<script type='text/javascript'>//<![CDATA[...//]]></script>

Share this post


Link to post
Share on other sites

OK

<script type="text/javascript">/*<![CDATA[*//*---->*/function MM_preloadImages(){ //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}/*--*//*]]>*/</script>

Share this post


Link to post
Share on other sites

ooops :facepalm: . I forgot the html validator is ...only for html. Anyway, what is the difference between CDATA & comment tags. I suppose i will remove the tags after the validation.

Share this post


Link to post
Share on other sites

So, CDATA are used so no errors appear when the parser "reads" javascript code. So, the parser which parses XHTML documents is an XML parser, not an HTML one? Within the CDATA tags, the XML parser ignores the code and the JavaScript parser takes over control? Is this how it works?

Share this post


Link to post
Share on other sites

The W3C HTML validator doesn't "validate" your Javascript — the CDATA markup declaration indicates that the contained text is just text, not HTML, and so it doesn't care anymore. Similar with the comment markup declaration (except that tells the parser the contents is a comment).P.S.: XHTML is a dialect of XML, and HTML is a dialect of SGML, so when it checks well-formedness it will use the relevant one.

Share this post


Link to post
Share on other sites

If CDATA declares the the content as text, then how the javascript parser "reads" it? I run the validator once more, The errors are very few now. Most of them are related with characters appearing in the URLs, which in turn are produced by Joomla.Why there characters appear as errors. I am considering leaving these errors as there are. What are the negative effects are going to be if i leave them as they are? Besides,I cannot do sth in the way joomla outputs URLs which in turn is related to its internal structure.

Edited by jimfog

Share this post


Link to post
Share on other sites

Have you set the links to search engine friendly SEF in config? it will show error for the & characters in index.php?this=that&that=this, and ask you to change it to & instead, But! with SEF links it will show domain/this/that instead. In javscript to comment out code you would use //js code or /* js code */, so /*<![CDATA[*//*---->*/ /*--*//*]]>*/will tell the validator to ignore its content as html code, the javascript will ignore it as commenting out code and proceed to process the code.

Edited by dsonesuk

Share this post


Link to post
Share on other sites

Regarding the SEF links i got it, i will do it cause i haven't so far.. Regarding the CDATA tags my q had another meaning. From the moment the code in CDATA tags is converted in text wouldn't be logical that javascript parser would be unable to read the specific code? Thanks and i hope i was more clear now.

Share this post


Link to post
Share on other sites

Javascript is just text. The browser's Javascript parser parses any text data that's between the <script> tags.

Share this post


Link to post
Share on other sites

Now it is clear to me, thanks.

Share this post


Link to post
Share on other sites

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...

×
×
  • Create New...