Azu Posted June 25, 2007 Share Posted June 25, 2007 Hi, the way my pages are generated, the title is created last. I could make it come first, but the performance would be a little bit slower then. So I am just wandering, is there a way that I can have the <title></title> near the end of the page while still being xhtml1.1 compliant? And if not, is there at least a way to make it so that it won't mess anything up? It seems to work right in FF/Opera/IE but I want to be sure it works right all the time. Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/ Share on other sites More sharing options...
.Stealth Posted June 25, 2007 Share Posted June 25, 2007 it has to be between the <head></head> for it to be compliant and it may not work in all browsers. Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-282370 Share on other sites More sharing options...
Azu Posted June 27, 2007 Author Share Posted June 27, 2007 Hmm.. I tried putting the <head></head> at the end.. but then it complains about my <body></body> and says my <html></html> isn't finished o_O <?header("Content-type: application/xhtml+xml; charset=iso-8859-1");?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><body><ins>Hello!</ins></body><head><title></title></head></html> Fails W3C =( Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-283949 Share on other sites More sharing options...
ToonMariner Posted June 27, 2007 Share Posted June 27, 2007 Azu - not wanting to offend but perhaps you should learn the html basics?? http://www.w3schools.com/html/default.asp Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-283971 Share on other sites More sharing options...
Azu Posted June 29, 2007 Author Share Posted June 29, 2007 Hi, I know that there is no standards compliant way to do this in plain HTML. I thought there might be a way in XHTML though. Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-285543 Share on other sites More sharing options...
ToonMariner Posted June 29, 2007 Share Posted June 29, 2007 well xhtml is even more strict in its requirement for good code so it (should) demand(s) that you are more standards compliant with your code - the base principles still apply and the title tag is still one that shoudl be in the header section to define the title of the page. w3schools have a decent xhtml section too btw... Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-285657 Share on other sites More sharing options...
LiamProductions Posted June 30, 2007 Share Posted June 30, 2007 Title should be at the top of page for the best standards and it will fail w3c if there not but try <html> <body>Your text ect</body> <head> <title>Your site</title> </head> </html> It will only work in a few browsers so i'd suggest putting it at the top Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-286569 Share on other sites More sharing options...
AndyB Posted June 30, 2007 Share Posted June 30, 2007 Title should be at the top of page for the best standards and it will fail w3c if there not but try There are no 'best standards', just a standard. Hi, the way my pages are generated, the title is created last. I could make it come first, but the performance would be a little bit slower then. Can you provide more information on that? What sort of title is generated 'last'? How are these pages generated? Why do you think 'performance' would be slower if the title were created first? How much slower - a microsecond or a minute? Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-286583 Share on other sites More sharing options...
Azu Posted July 2, 2007 Author Share Posted July 2, 2007 On one page, I need to query data from a database(which I have no control of, only read). I need to select a row with a certain ID, and from that some text, and another ID. Then I need to do the same with that ID, etc, until there is no more. Then I take the first word from the last row and search another table for it, and that result from that should be the title. And it takes a while to generate. So I can either not display any of the data until I have gotten it all, and then stick the title on the front and then display the data Or I can display each line as it is retrieved, and then put in the title. But I don't know how to do this without making the page not valid. I would really like a way to do this, I don't how know to though.. Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-287668 Share on other sites More sharing options...
sushant_d84 Posted July 2, 2007 Share Posted July 2, 2007 hey Just Insert this code before the end of Body so u r problem get solved <script> document.title="This is Title " </script> Quote Link to comment https://forums.phpfreaks.com/topic/57148-solved-near-end-of-page/#findComment-287894 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.