PDA

View Full Version : JS in included $template


Trommsdorff
11-25-2005, 09:12 PM
Hello,

I made a template called sidebar and reference it successfully using $sidebar. I successfully included it into the site and it does what I need it to do.

Here's an example of the first HTML line in $template:


<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="$stylevar[tablewidth]" align="center">


However, in this template, it draws a column with some includes from a sister site. However, I want it to not draw the column if the screen width is 800 or lower.

So, I changed the first line to this:


<script type="text/javascript"><!--
if (screen.availwidth>800) {
document.write("<table cellpadding=\?$stylevar[outerborderwidth]\? cellspacing=\?0\? border=\?0\? class=\?tborder\? width=\?$stylevar[tablewidth]\? align=\?center\?>");
REST OF CODE HERE
}
else;
//--></script>


Now, it's like Vbulletin doesn't include it at all. It's not drawn on the HTML display, it's not in the source code, there are no JS errors, it's like VB just doesn't include it. $sidebar is located in a <td></td> section, and in that section there is nothing in the source code.

Any ideas?

Trommsdorff
11-27-2005, 03:32 AM
Bump - -- desperate for help here!