Click to See Complete Forum and Search --> : This Default Blogger Template Javascript Error!


TheL1Ranger
09-27-2003, 12:15 AM
This Default Blogger (http://www.blogger.com/) Template Javascript:

<script type="text/javascript" language="Javascript">if(location.href.indexOf("archive")!=-1) document.write("<li><strong><ahref="<$BlogURL$>">CurrentPosts</a></strong></li>");</script>

Is Producing These "Errors":

0112: [2]^<script type="text/javascript" language="Javascript">if (location.href.indexOf("archive")!=-1) document.write("<li><strong><a href=\"http://recallguinn.blogspot.com\">Current Posts<[3]^/a[4]^></stro[5]^ng[6]^></[7]^li>")[8]^;</script>----:
[2]^Error: missing start tag <li>. ----:

[3]^Warning: '<' + '/' + letter NOT allowed in script. ----:
[3]^Hint: use '\' to escape the '/' character for end tag embedded in script. ----:
[3]^Repair: replacing '</' with '<\/' for end tag embedded in script. ----:

[4]^Warning: '<' + '/' + letter NOT allowed in script. ----:
[4]^Hint: use '\' to escape the '/' character for end tag embedded in script. ----:
[4]^Repair: replacing '</' with '<\/' for end tag embedded in script. ----:

[5]^Warning: '<' + '/' + letter NOT allowed in script. ----:
[5]^Hint: use '\' to escape the '/' character for end tag embedded in script. ----:
[5]^Repair: replacing '</' with '<\/' for end tag embedded in script. ----:

[6]^Warning: '<' + '/' + letter NOT allowed in script. ----:
[6]^Hint: use '\' to escape the '/' character for end tag embedded in script. ----:
[6]^Repair: replacing '</' with '<\/' for end tag embedded in script. ----:

[7]^Warning: '<' + '/' + letter NOT allowed in script. ----:
[7]^Hint: use '\' to escape the '/' character for end tag embedded in script. ----:
[7]^Repair: replacing '</' with '<\/' for end tag embedded in script. ----:

[8]^Warning: '<' + '/' + letter NOT allowed in script. ----:
[8]^Hint: use '\' to escape the '/' character for end tag embedded in script. ----:
[8]^Repair: replacing '</' with '<\/' for end tag embedded in script.


Reference: Error Report (http://r.netmechanic.com/toolbox/html_repair/cr.cgi?f=f/007/267/1205/26-09292/&p=1&vi=1&fp=1&fv=5&s=NetMechanic)

I'm Sure That, It Is Possible To Correct This Problem But, I Don't Feel Properly Qualified To Make The Changes To My Javascript In My Default Blogger (http://www.blogger.com/) Template!

(...& This May Be a Problem on ALL Blogger (http://www.blogger.com/) Templates!)

Can You Help?

Website Reference: Tony Dane's ReCallKennyGuinn.Com Daily Web Blog! (http://www.recallguinn.blogspot.com/)

Jona
09-27-2003, 12:57 PM
Try using <!-- after the starting <script> tag, and //--> before the ending </script> tag...

[J]ona

TheL1Ranger
09-27-2003, 01:06 PM
Originally posted by Jona
Try using <!-- after the starting <script> tag, and //--> before the ending </script> tag...

[J]ona

O.K.! Like This...

<script type="text/javascript" language="Javascript"><!--if (location.href.indexOf("archive")!=-1) document.write("<li><strong><a href=\"<$BlogURL$>\">Current Posts</a></strong></li>");--//></script>

Checking...

Jona
09-27-2003, 01:18 PM
The slashes (//) go before the dashes (--) at the end.

[J]ona

TheL1Ranger
09-27-2003, 01:23 PM
Same Problem...


Line 135, column 55: document type does not allow element "script" here; assuming missing "li" start-tag
...ext/javascript" language="Javascript"><!--if (location.href.indexOf("archive"
^
Line 135, column 210: invalid comment declaration
...>Current Posts</a></strong></li>");--//></script>
^
Line 135, column 56: comment declaration started here (explain...).
...xt/javascript" language="Javascript"><!--if (location.href.indexOf("archive")
^
Line 136, column 6: end tag for "li" omitted, but OMITTAG NO was specified
</ul>
^
Line 135, column 3: start tag was here (explain...).
<script type="text/javascript" language="Javascript"><!--if (location.href.in
^



HUUUUUUUUUUUMMMMMMMMMM!

TheL1Ranger
09-27-2003, 01:26 PM
Originally posted by Jona
The slashes (//) go before the dashes (--) at the end.

[J]ona

O.K.!!!


<script type="text/javascript" language="Javascript"><!--if (location.href.indexOf("archive")!=-1) document.write("<li><strong><a href=\"<$BlogURL$>\">Current Posts</a></strong></li>");//--></script>

Resubmiting!

Jona
09-27-2003, 01:26 PM
<script type="text/javascript"><!--
if(location.href.indexOf("archive")!=-1){
document.write("<li><strong><a href=\"$BlogURL$\">Current Posts</a></strong></li>");
}
//--></script>


[J]ona

TheL1Ranger
09-27-2003, 01:31 PM
Results...

Line 134, column 55: document type does not allow element "script" here; assuming missing "li" start-tag
...ext/javascript" language="Javascript"><!--if (location.href.indexOf("archive"
^
Line 135, column 6: end tag for "li" omitted, but OMITTAG NO was specified
</ul>
^
Line 134, column 3: start tag was here (explain...).
<script type="text/javascript" language="Javascript"><!--if (location.href.in
^


?

Jona
09-27-2003, 01:36 PM
Copy the code that I have posted exactly and then try it.

[J]ona

TheL1Ranger
09-27-2003, 01:42 PM
Oh! I Did!

<ul>
<BloggerArchives><li><a href='<$BlogArchiveLink$>'><$BlogArchiveName$></a></li></BloggerArchives>
<script type="text/javascript"><!--
if(location.href.indexOf("archive")!=-1){
document.write("<li><strong><a href=\"$BlogURL$\">Current Posts</a></strong></li>");
}
//--></script>

</ul>


Results:


Line 134, column 33: document type does not allow element "script" here; assuming missing "li" start-tag
<script type="text/javascript"><!--
^
Line 140, column 20: end tag for "li" omitted, but OMITTAG NO was specified
</ul>
^
Line 134, column 3: start tag was here (explain...).
<script type="text/javascript"><!--

Jona
09-27-2003, 01:49 PM
Try...


<ul>
<li><BloggerArchives><a href='<$BlogArchiveLink$>'><$BlogArchiveName$></a></BloggerArchives>
<script type="text/javascript"><!--
if(location.href.indexOf("archive")!=-1){
document.write("<li><strong><a href=\"$BlogURL$\">Current Posts</a></strong></li>");
}
//--></script>
</li></ul>


[J]ona

TheL1Ranger
09-27-2003, 01:54 PM
O.K.!

Resubmitting...

TheL1Ranger
09-27-2003, 02:07 PM
That WORKS!!!

Thank YOU! [J]ona!!!

I'm Going To Submit That, To Blogger, (After Reviewing The Other Default Templates, Along w/This Thread) As a Correction/Fix!

My Page Still Doesn't Validate XHTML 1.0 Transitional: "This page is not Valid XHTML 1.0 Transitional!"

Validation Results (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.recallguinn.blogspot.com%2F)

But, w/Your Help, I Have 1 Less Problem To Solve!

Thank You! Agian, [J]ona!!!

Jona
09-27-2003, 02:51 PM
Post in the HTML or XML forum if you need any help making it valid XHTML 1.0 strict.

[J]ona

pyro
09-27-2003, 02:55 PM
Though looking through the validation results, I can tell you that a vast majority of your errors can be fixed by using ALA's method of inserting your flash content (http://www.alistapart.com/stories/flashsatay/) and changing all & in the urls to &amp;amp;

TheL1Ranger
09-27-2003, 03:05 PM
O.K.! Thanks! pyro!

I'll L@@K@That...

Also, I Was Thinking About Nanosecond ReDirects For The Problematic URLs!

Right Now, I Want To finish My Work on [J]onas' Updated Javascript!

I'll Be Back To "Post in the HTML or XML forum if you need any help making it valid XHTML 1.0 strict."

Thanks Again! :)

pyro
09-27-2003, 03:07 PM
Sure thing... :)

TheL1Ranger
09-27-2003, 05:24 PM
Originally posted by pyro
Though looking through the validation results, I can tell you that a vast majority of your errors can be fixed by using ALA's method of inserting your flash content (http://www.alistapart.com/stories/flashsatay/) and changing all & in the urls to &amp;amp;

Added The "&amp;" To The Problematic "URLs"!

Fixed-*IT*!

Thank You!

Validation Results (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.recallguinn.blogspot.com%2F)

pyro
09-27-2003, 06:02 PM
Now once you fix up the flash, you should be good to go... :)

TheL1Ranger
09-27-2003, 07:36 PM
Originally posted by pyro
Now once you fix up the flash, you should be good to go... :)

:)...O.K.! Movin' Over 2 The Web Developer Forum - HTML (http://forums.webdeveloper.com/forumdisplay.php?s=&forumid=2)!

TheL1Ranger
09-28-2003, 01:24 AM
OOOooopppPPPHHHs! D'er's 1 Lil'Thang That, I Over-L@@Ked!

Now, The JavaScript Doesn't Work!

The JavaScript Points To: http://www.recallguinn.blogspot.com/$BlogURL$

Reference: Tony Dane's ReCallKennyGuinn.Com Daily Web Blog! (http://www.recallguinn.blogspot.com/)

Click On Any One of The Archive Periods In The Right Hand Column:

Archives
08/31/2003 - 09/06/2003
09/07/2003 - 09/13/2003
09/14/2003 - 09/20/2003

...& "Current Posts" Will Appear!

Click On "Current Posts" = "404" : Points To http://www.recallguinn.blogspot.com/$BlogURL$

HUUUUUUUUUUMMMMMMMMMMMMM???

TheL1Ranger
10-17-2003, 02:39 PM
***Javascript Problem Solved***

How do I include archive links on the main page of my blog?

Answer:
You can now include your archive listing on the main page of your blog without resorting to messy javascript. For example:

<BloggerArchives>
<a href='<$BlogArchiveURL$>'><$BlogArchiveName$></a>
</BloggerArchives>

Notes:

This will include a *complete* listing of your archives, not a partial one.

Source: BLOGGER - Knowledge Base (http://help.blogger.com/bin/answer.py?answer=97&topic=21)

Reference Website: ReCallKennyGuinn.Com (http://www.recallguinn.blogspot.com/)

:cool:...Ra!!!