XHTML valid...

Status
Not open for further replies.

DecemberGuild

New Member
Messages
107
Reaction score
0
Points
0
I know there's another topic on this, but I didn't want to clutter or hijack the thread, so I'm posting this here.
I have looked over the advanced and corporate ads, and I rewrote them to fit XHTML transitional and strict, as well as display neat, clean coding.
I know that the advertisements must contain a certain line of code so the scanner can pick them up. All XHTML-required changes will be in red; if the scanner cannot pick up the script because of a red segment, then I recommend updating the scanner to fit the new internet standard of XHTML.
Note: Green number tags are used to explain the change, and aren't part of the quoted code.


Advanced
Transitional:
<script type='text/javascript'>(1)
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script type='text/javascript'(1) src='");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:3&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script>
<noscript>
<a href='http://x10hosting.com/advert/adclick.php?n=a915c788' target='_blank'>
<img src='http://x10hosting.com/advert/adview.php?what=zone:3&amp;n=a915c788' border='0' alt='' />(2)
</a>
</noscript>
1: Removed the 'language' tag. XHTML uses only the 'type' tag and will consider any HTML page that uses 'language' invalid.
2: Closed the image tag properly. This is important in XHTML.

Strict:
<script type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script type='text/javascript' src='");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:3&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script>
<noscript>
<p>(1)
<a href='http://x10hosting.com/advert/adclick.php?n=a915c788'>(2)
<img src='http://x10hosting.com/advert/adview.php?what=zone:3&amp;n=a915c788' style='border-width:0px;'(3) alt='' />
</a>
</p>
</noscript>
1: The <a> tag must be wrapped in a <p> tag.
2: Removed the 'target' tag. XHTML strict doesn't support this.
3: Changed the 'border' tag. XHTML strict doesn't support this, and this must be done via CSS.


Corporate
Transitional:
<script type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script type='text/javascript' src='");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:1&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script>
<noscript>
<a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'>
<img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt='' />
</a>
</noscript>

Strict:
<script type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script type='text/javascript' src='");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:1&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script>
<noscript>
<p>
<a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d'>
<img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' style='border-width:0px;' alt='' />
</a>
</p>
</noscript>

All four of these codes have been run through the XHTML validator at the W3C website, and have passed. Let me know if these codes are acceptable.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
These should be acceptable, wait for Corey, Bryon, Alejandro, or Richard to give the ok, and I might sticky it.
 

yahia

New Member
Messages
338
Reaction score
0
Points
0
I'm not looking for blindly (x)HTML approved code.
Javascript shouldn't be inside the code; and even the thread you're refering to has a code where the JS code still in there, and still inside <!-- //-->
=> a hack of the 90s.

Also, with true XHTML, document.write isn't allowed, or is dangerous for the webpage.
And the Javascript code inside <script/> should be inside
<![CDATA[ ............ ]]> or similar.

The best way is to have an external file with all the javascript inside of it, like I suggested.
 

nol888

New Member
Messages
292
Reaction score
0
Points
0
I'm not looking for blindly (x)HTML approved code.
Javascript shouldn't be inside the code; and even the thread you're refering to has a code where the JS code still in there, and still inside <!-- //-->
=> a hack of the 90s.

Also, with true XHTML, document.write isn't allowed, or is dangerous for the webpage.
And the Javascript code inside <script/> should be inside
<![CDATA[ ............ ]]> or similar.

The best way is to have an external file with all the javascript inside of it, like I suggested.
Even though, you should just be happy that x10 is giving you free web hosting with minimally invasive ads.
You don't really need valid (X)HTML code either.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Exactly, we can try to provide you with the best solution, but if you want (x)html valid pages, try ad free. This ensures that the end user, you, can get what he/she wants without our ads interfering.
 

nol888

New Member
Messages
292
Reaction score
0
Points
0
True, still, those adjustments ARE valid, and Brandon seems to think it is ok, I just might use these. One more step toward validity! xD

Edit: I mean that, towards yahia, for me, just having the javascript code vaildate, without passing all those "standards", is fine. Not all webpages have to be a stringent example of the "this-is-the-perfect-webpage-that-is-extremely-valid-and-all-people-have-to-follow-it-to-make-a-webpage" thing. Not all that stuff is needed, and if it validates at the bare minimum, that should be good enough =/
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
I dont know but they should, might want for an admin to verify it.
 

nol888

New Member
Messages
292
Reaction score
0
Points
0
ok.

i haven't used it yet, i read about letting an admin approve it first
 

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
203
Points
63
As long as the ads are shown correctly you can use the above modified code. We will look into modified code shortly to allow users some added freedom.

-Corey
 

nol888

New Member
Messages
292
Reaction score
0
Points
0
Yay! I'm putting the newly approved code in my webpage right now xD
 

yahia

New Member
Messages
338
Reaction score
0
Points
0
nol888: I agree with you, x10 is giving excellent hosting.
It's just that I'm a html freak having all my webpages validated and semantic... (I'm sorry for that?) :D

And BTW, I cannot use the ad-free offer you pointed out, Brandon.

So, according to Corey, I can use my code in this thread without problem.
 
Status
Not open for further replies.
Top