Hey guys. My blog was working perfectly for months and then suddenly it stopped working.
http://mtgdrafts.blogspot.com
The problem is that when you click the "Pick" links in the blog posts nothing happens. Before, when it was working properly, the pick would appear.
Using the error console I found that "reveal_layer" is not being defined. Looking at the source code, it appears that the javascript is being condensed into a single line... for some reason. Here is what the code is:
<script type='text/javascript' language='JavaScript'>
<!--
function reveal_layer (object) {
if (document.getElementById) {
document.getElementById(object).style.display = 'inline';
}
else if (document.layers && document.layers[object]) {
document.layers[object].display = 'inline';
}
else if (document.all) {
document.all[object].style.display = 'inline';
}
}
function hide_layer (object) {
if (document.getElementById) {
document.getElementById(object).style.display = 'none';
}
else if (document.layers && document.layers[object]) {
document.layers[object].display = 'none';
}
else if (document.all) {
document.all[object].style.display = 'none';
}
}
-->
</script>
This is what I see when I view the page source:
<script language='JavaScript' type='text/javascript'>
<!-- function reveal_layer (object) { if (document.getElementById) { document.getElementById(object).style.display = 'inline'; } else if (document.layers && document.layers[object]) { document.layers[object].display = 'inline'; } else if (document.all) { document.all[object].style.display = 'inline'; } } function hide_layer (object) { if (document.getElementById) { document.getElementById(object).style.display = 'none'; } else if (document.layers && document.layers[object]) { document.layers[object].display = 'none'; } else if (document.all) { document.all[object].style.display = 'none'; } } -->
</script>
Now, what troubles me is the ending of the code. Normally I would put //--> instead of the --> that is there. However, blogger is being retarded and gives me an error whenever I try to do that.
Finally, when I copy and paste the code into blogger and save the template and then review the template code it looks like blogger is editing my code to this:
<script language='JavaScript' src='http://www.wizards.com/global/basic.js' type='text/javascript'/>
<script language='JavaScript' type='text/javascript'>
<!--
function reveal_layer (object) {
if (document.getElementById) {
document.getElementById(object).style.display = 'inline';
}
else if (document.layers && document.layers[object]) {
document.layers[object].display = 'inline';
}
else if (document.all) {
document.all[object].style.display = 'inline';
}
}
function hide_layer (object) {
if (document.getElementById) {
document.getElementById(object).style.display = 'none';
}
else if (document.layers && document.layers[object]) {
document.layers[object].display = 'none';
}
else if (document.all) {
document.all[object].style.display = 'none';
}
}
-->
</script>
I'm totally lost. What is going on here?
Posts
Did you fix it already?
If the JS is being condensed in certain browsers, it might be a better idea to create an external Javascript file and just have the page source it, rather than putting it all in the actual HTML page. Could be some sort of add blocker or something messing up the script on the page.
Having it external is better practice anyway.