Forum Moderators: open
I wanted to change the title of my web pages so I did like this:
<SCRIPT>
top.document.title.value = '';
top.document.title = top.curCatName + " Templates";
</SCRIPT>
it is working fine and the title on the title par for the Internet explorer changed successfully but if I open the page as HTML code the title in the title tag (<title>< /title >) do not change, so how can I let the tile in the title tag to change by using java script?
Technically possible - one might have default <title> for search engines and then change it dynamically for those browsers that support it.
I am struggling to find good reason for that however.
But I do not understand why I can not change it in the same html code!
You mean you expected to see title changed after page was loaded in place of <title> tags in source preview? If that, then its not happening because its source view, ie original source of the page, not current run-time version.
The only way to get it in source is to generate it server side (once).