"parent.document.title=" issue
Posted: Wed Jan 14, 2009 11:25 am
Hello all,
First post here. I'm a noob to PHP and Javascript I'm vaguely familiar with. I have tried to implement simple PHP headers and footers for a current site I'm working on. Simple enough, I include both the header and footer on each content.php, works like a charm and will save me so much time and effort down the road when the client wants to add a new page to the site.
My problem... yes I know. I talk to much...
200+ pages. I've implemented free find search functionality to the site so users can search the site. However, the results always show the default title given in the header.php. I've used javascript on each of the content.phps in order to change the page title onload of the page.
The problem lies when the user searches. The results all have the link labeled as the default header. The search results are correct, just doesn't look right when each page that returns from the search all have the same page title. How can I push the js above into the search results, so the results display the replaced title? Or is there a better way to work out this titling issue?
Thanks for your help on this one guys. As I delve more and more into PHP, I'm certain this forum will be a valuable resource for me.
wheatleyweb
First post here. I'm a noob to PHP and Javascript I'm vaguely familiar with. I have tried to implement simple PHP headers and footers for a current site I'm working on. Simple enough, I include both the header and footer on each content.php, works like a charm and will save me so much time and effort down the road when the client wants to add a new page to the site.
My problem... yes I know. I talk to much...
200+ pages. I've implemented free find search functionality to the site so users can search the site. However, the results always show the default title given in the header.php. I've used javascript on each of the content.phps in order to change the page title onload of the page.
Code: Select all
<script type="text/javascript">
void(parent.document.title='Title Title Title');
</script>Thanks for your help on this one guys. As I delve more and more into PHP, I'm certain this forum will be a valuable resource for me.
wheatleyweb