PHP include breaks Javascript
Posted: Mon Oct 02, 2006 10:10 pm
Weirdan | Please use
I know the remote JS reference to the transmenu script in the header is correct because the remote stylesheet reference is working (and the transmenu script folder is on the same level as the template folder holding the CSS file) - so we can also rule that out. Is there a history of php includes breaking javascript that Im not aware of? If anybody can lend a hand, I would be most appreciative. I think our server is running PHP5 but Im not exactly sure which release.
thanks
john serrao
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello PHP forum-
I have a weird problem that I have uncovered. It seems that my php include files render all my javascript references invalid. I am redesigning a site and this is seriously screwing things up for me.
On one of my test sites, I have been debugging all my XHTML/CSS stuff in one HTML so I wouldnt have to worry about parsing the page apart during the debugging phase. Now I have the skeleton of the page relatively bug free (I mean you can never account for IE completely), I want to apply my test site over to my template system in movable type. The way I have done this in the past is by using little php files for each part of my site (header, footer, etc) and then in the main page I just php include them all together. In my new design the structure is the same, but javascript is playing a much bigger role so this is a real problem now.
The links at the bottom of the header in all the following examples SHOULD produce a nifty little sliding javascript menu - which is how I know the code isnt working on the parsed version (tested on FF1.5, IE6 and Opera 9). I have done a number of checks and there is no real difference in the code, except the fact that Im doing a php include for the header in the last rendition.
Non-parsed purely HTML version outside of the MT system (the base code for the other pages - check the view source to see code)
http://www.humanproductivitylab.com/tes ... _test.html
The non-parsed version run through the MT engine (shows MT is NOT the problem, like I thought it might be):
http://www.humanproductivitylab.com/tes ... nscopy.php
The php parsed version run through the MT framework:
http://www.humanproductivitylab.com/test/
Here is the code of the parsed version because maybe Im just missing something real simple:Code: Select all
<?php
//included code for page header
include ('/home/hplmt/public_html/test/header.inc.php');
?>
<div id="container_content">
<div id="content_primary">
[content ommitted to save space]
</div>
<?php
//included code for rightnav column
include ('/home/hplmt/public_html/test/rightnav.inc.php');
?>
</div>
<?php
//included code for page footer
include ('/home/hplmt/public_html/test/footer.inc.php');
?>thanks
john serrao
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]