|
Posted by TheQuim on 09/25/06 12:51
William van Zwanenberg wrote:
> Hi there,
>
> I wonder if you guys can help.
>
> I'm currently experiencing some coding problems what with trying to use PHP
> and javascript in tandem.
>
> What I'm ultimately trying to achieve is use Javascript to access the DOM
> objects of any given page within the web site I'm building to dyanamically
> resize any and all text elements. I have Javascript some code that works
> perfectly when used in isolation via a flat XHTML page however it's when I try
> to use that same code in PHP rendered pages where the content derives from a
> PHP include, that problems arise and it just doesn't appear to work at all.
>
> So as to explain this ina alittle more detail let me say that my website is
> built around a 3 collumn format with a header and footer. With this 3
> collumns, you have a left-hand navigation bar and a righ-hand navigation bar.
> It is within the middle and largest collumn, that content is displayed.
>
> At the moment, the XHTML for the header and footer is included via a PHP
> include. The the 3 central collumns are established via a PHP template and it
> is into the middle collum that content is dynamically inserted via yet another
> PHP include. These includes either retrive content from a databse lookup of a
> MySQL database or from a series of plain text files.
>
> The Javascript code that I spoke of above and which I know works well when
> used in flat XHTML pages, is included via the header PHP include code and is
> contained within the <head> ... </head> tags. What I want to know is why, if
> the Javascript is included in this way, do the functions included in this code
> not access and therefore chnage the page elements if these page elements are
> introduced via a PHP include?
>
> I can see no obvious reason why this shouldn't work so if anyone has any
> suggestions or advice on how to get this to work, I'd be very grateful
>
> Please reply to: willvz@ntlworld.com
>
> Many thanks.
>
> Will
>
>
>
Will,
If you aren't already using Firefox, try doing so as it has a wonderful
JavaScript debugger, that should at least give you an idea of what might
be going on.
Just make sure that your browser source is displaying the included lines
of Javascript, if it is then there must be an error occuring and the
debugger will help.
Regards
Q.
[Back to original message]
|