I'm using the shopping cart system Volusion, which doesn't allow me have different templates for each page or does it allow php or asap so i have to use JS. My problem is I don't wish to have a sidebar on the home page. So with javascript I'm trying to say only if $var is == to homepage dont display sidebar.
My javascript is currently not at a high level, and after search the internet I can up with this script. which doesn't seem to show the heading3 but shows the text working. why is this.
is javascript the best way and easiest way i can do this?; can this be written better? or use jquery for a more modern way?
Code:
<script type="text/javascript">
<!--
var myPage = homepage;
if(myPage == homepage){
var sidebar=" ";
}else{
var sidebar="";
sidebar += "<h3 id='Menu2_Title'></h3>";
sidebar += "working";
}
//-->
</script>
<script type="text/javascript">document.write(sidebar);</script>
Not very clear: you can or you can not use PHP, for instance? If not, why? If you can write a javascript code somewhere, definitely you can write a php code as well, if the server has installed PHP, of course
My javascript is currently not at a high level, and after search the internet I can up with this script. which doesn't seem to show the heading3 but shows the text working. why is this.
I'm not sure I really understand your problem, but from the code you've quoted its fairly easy to see why the <h3> element doesn't show--there's nothing between <h3> and </h3> at all.
Bookmarks