WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: unexplained code changes

for

Number of posts in this thread: 3 (In chronological order)

From: Tania
Date: Sat, Nov 28 2009 8:05PM
Subject: unexplained code changes
No previous message | Next message →

Hello list members,

I hope a member can enlighten me about some javascript code changes on my webpage. I do not know javascript but has google ads in my webpage which uses it. Yesterday, after checking a new webpage i found there are 2 additional lines added to the beginning of the google ad script.



WHAT DO THE NEW CODES STAND FOR?



I did not add them in. the codes were copied from an old webpage. Everything was done in my computer. The old webpage had been verified by google. I don't realize when the additional lines were added in- and certainly not by me! I am the only one using the PC which is password protected.



Below are the NEW changed lines follow by what google had provided initially. Only the affected lines are shown:



NEW CHANGED LINES:



<script type="text/javascript">

//<![CDATA[

<!--

google_ad_client = "pub-2861774129555327";

From: G. Sørtun
Date: Sun, Nov 29 2009 2:10AM
Subject: Re: unexplained code changes
← Previous message | Next message →

Tania wrote:
> I hope a member can enlighten me about some javascript code changes
> on my webpage. I do not know javascript but has google ads in my
> webpage which uses it. Yesterday, after checking a new webpage i
> found there are 2 additional lines added to the beginning of the
> google ad script.
>
> WHAT DO THE NEW CODES STAND FOR?

CDATA section start - CDStart, followed by the original HTML comment
start. There's most likely a "CDEnd" at the end of that script block
too, as the CDATA section wouldn't be complete without it.

See: <http://www.w3.org/TR/REC-xml/#sec-cdata-sect>;

In the right context - in an XML/XHTML document - the start and end of
the HTML comment is redundant as a CDATA section markup does the same
thing - gets interpreted the same way. In your case it looks like
"butter on fat" with an HTML comment inside a CDATA section, but it does
no real harm in there.

In all documents the HTML comment can be left out when the script block
is marked up correctly as <script ...> .... </script> - regardless of
what the markup is interpreted as, as only extremely old and by now
totally obsolete browsers made "uncommented" scripts visible. Such old
browsers don't treat CDATA section start/end correctly either - they
don't understand such section markers, but no problems in any
half-decent browser that's less than 10 years old.

> I did not add them in. the codes were copied from an old webpage.
> Everything was done in my computer. The old webpage had been verified
> by google. I don't realize when the additional lines were added in-
> and certainly not by me! I am the only one using the PC which is
> password protected.

Probably some version of the "HTML Tidy" clean-up program included in
your source-code editing package, which, rightly or wrongly, has
interpreted the markup to be XML/XHTML.
I do of course not really know if HTML Tidy _is_ part of your editor
package, or how it is set up, but there aren't all that many other
widespread source code clean-up programs around that may add such CDATA
sections markers...

See: <http://www.w3.org/People/Raggett/tidy/>;

HTML Tidy is quite useful when set up, and used, right, but when
included in editors Tidy is in my experience often made useless by
default...

Comment: <http://www.gunlaug.no/contents/wd_1_07.html>;

regards
Georg

From: Tania
Date: Sun, Nov 29 2009 4:10AM
Subject: Re: unexplained code changes
← Previous message | No next message

thank you very much for your informative explaination. yes my editor do
have tidy, which i use occasionally. now i know where the source of
potential trouble is.

thanks again

regards
tania

---- Original Message -----
From: ""G. Sørtun"" < = EMAIL ADDRESS REMOVED = >
To: "WebAIM Discussion List" < = EMAIL ADDRESS REMOVED = >
Sent: Sunday, November 29, 2009 5:08 PM
Subject: Re: [WebAIM] unexplained code changes


> Tania wrote:
>> I hope a member can enlighten me about some javascript code changes
>> on my webpage. I do not know javascript but has google ads in my
>> webpage which uses it. Yesterday, after checking a new webpage i
>> found there are 2 additional lines added to the beginning of the
>> google ad script.
>>
>> WHAT DO THE NEW CODES STAND FOR?
>
> CDATA section start - CDStart, followed by the original HTML comment
> start. There's most likely a "CDEnd" at the end of that script block
> too, as the CDATA section wouldn't be complete without it.
>
> See: <http://www.w3.org/TR/REC-xml/#sec-cdata-sect>;
>
> In the right context - in an XML/XHTML document - the start and end of
> the HTML comment is redundant as a CDATA section markup does the same
> thing - gets interpreted the same way. In your case it looks like
> "butter on fat" with an HTML comment inside a CDATA section, but it does
> no real harm in there.
>
> In all documents the HTML comment can be left out when the script block
> is marked up correctly as <script ...> .... </script> - regardless of
> what the markup is interpreted as, as only extremely old and by now
> totally obsolete browsers made "uncommented" scripts visible. Such old
> browsers don't treat CDATA section start/end correctly either - they
> don't understand such section markers, but no problems in any
> half-decent browser that's less than 10 years old.
>
>> I did not add them in. the codes were copied from an old webpage.
>> Everything was done in my computer. The old webpage had been verified
>> by google. I don't realize when the additional lines were added in-
>> and certainly not by me! I am the only one using the PC which is
>> password protected.
>
> Probably some version of the "HTML Tidy" clean-up program included in
> your source-code editing package, which, rightly or wrongly, has
> interpreted the markup to be XML/XHTML.
> I do of course not really know if HTML Tidy _is_ part of your editor
> package, or how it is set up, but there aren't all that many other
> widespread source code clean-up programs around that may add such CDATA
> sections markers...
>
> See: <http://www.w3.org/People/Raggett/tidy/>;
>
> HTML Tidy is quite useful when set up, and used, right, but when
> included in editors Tidy is in my experience often made useless by
> default...
>
> Comment: <http://www.gunlaug.no/contents/wd_1_07.html>;
>
> regards
> Georg
>