How to enable HTML Includes

6 posts / 0 new
Last post
#1 Fri, 03/20/2009 - 03:38
rduval

How to enable HTML Includes

I have a customers website that I d/l from another server that was working fine but now the menus don't exist and I'm thinking it has something to do with the HTML includes

It uses HTML includes which calls javascript files to make the menu along with a css file.

I tried going into Webmin->Servers->Apache Webserver->"theserver"->Edit Directives and changed the Options to Server Side Includes to Yes, saved and "Apply Changes". I even restarted the httpd service but it still doesnt work. It shows like this:

[code:1]<Directory /home/mapleleaflawncare.com/public_html> Options -Indexes Includes FollowSymLinks /etc/httpd/conf/httpd.conf (1055) allow from all /etc/httpd/conf/httpd.conf (1056) AllowOverride All /etc/httpd/conf/httpd.conf (1057) </Directory> [/code:1]

Am I missing some other setting?

Fri, 03/20/2009 - 05:01
andreychek

Well, there's different kinds of &quot;includes&quot; -- what I initially thought you meant was Server Side Includes (SSI), which generally involves files with names ending in &quot;.shtml&quot;.

However, after re-reading your post, I suspect you're actually just having a problem calling JavaScript and CSS from a standard HTML file. And that's usually because either the path or filename is spelled wrong, or due to a syntax error in the file.

If you're using Firefox, you could open up the error console in Tools -&gt; Error Console, and it will tell you what's going on. If it's trying to pull down the file and it can't find it, it will say as much, and you can correct that. If there's a syntax error, it'll tell you what and where it is.

However, if you are interested in Server Side Includes, those are described at this link below, but I suspect this is not what you want :-)

http://httpd.apache.org/docs/2.2/mod/mod_include.html

Fri, 03/20/2009 - 10:17 (Reply to #2)
rduval

Thanks very much for all the info.

Sun, 06/07/2009 - 07:48
rduval

Thanks for the clarification and the error console.

I found out that the problem seems to be in the Javascript on line 7 of the following code.

[code:1]// Global Variables
var mmouseoverfontWeight, mmouseoverfontStyle, mmouseoverbackgroundColor, mmouseovercursor, mmouseoverbackgroundImage;

function MSetNavBarDownID(navbarid, newClass)
{
var obj = document.getElementById(navbarid);
obj.className=newClass;
}

[/code:1]

where is says &quot;obj.className=newClass;&quot; according to firefox &quot;obj is null&quot;

I know this isn't a Virtuamin thing but just hoping yoiu have an idea.

Sun, 06/07/2009 - 07:48
rduval

Thanks for the clarification and the error console.

I found out that the problem seems to be in the Javascript on line 7 of the following code.

[code:1]// Global Variables
var mmouseoverfontWeight, mmouseoverfontStyle, mmouseoverbackgroundColor, mmouseovercursor, mmouseoverbackgroundImage;

function MSetNavBarDownID(navbarid, newClass)
{
var obj = document.getElementById(navbarid);
obj.className=newClass;
}

[/code:1]

where is says &quot;obj.className=newClass;&quot; according to firefox &quot;obj is null&quot;

I know this isn't a Virtuamin thing but just hoping yoiu have an idea.

Fri, 03/20/2009 - 06:24
andreychek

Well, some where in the script, MSetNavBarDownID() is being called, and the first parameter is the name of the &quot;navbarid&quot;.

It's an &quot;ID&quot; tag of some navigation bar somewhere, most likely.

If the error says that obj is null, that means that the ID in question doesn't exist.

That could imply a bug in the code somewhere if it's passing in the wrong ID.

Or, if anyone tweaked the HTML code, and maybe removed something that the above function was trying to operate on, that could cause the issue. It's also possible that some other JavaScript that setup the navbar doesn't load properly -- or maybe is loading in the wrong order. The order that JavaScript is processed in matters.

So, there's a lot of possible causes -- I hope the above at least helps point you in the right direction :-)
-Eric

Topic locked