I’m trying to get this content loader to work and I’ve managed to get it to get new content, once the content is loaded it isn’t styled correctly. Also the character “é” becomes a questionmark. Doctype problem? As well as the h2 tag normally having Cufon applied to it is not triggering.
So basically, this content loader require me to have a bunch of pages being essentially the same, except for the content I want to retreice. This way, users can use the actual URL as you’d normally exect. Only when a link is clicked on an already loaded page, it’s only the content from the #content div that’s realle being replaced.
I can post code here, but I think it’s better to just watch it happen on the testpage. It’s very low on graphics btw 😉
Just click the blue text link and you’ll see it. Also, the red button on the second loaded content is supposed to revert the content back to previous. But it’s not being triggered or something. What’s happening?
The
�is becausenew_user.phpis an ISO-8859-1 file.XMLHttpRequest, which is used to fetch the page, defaults to UTF-8. SinceXMLHttpRequestdoesn’t know about HTML, it will ignore the<meta>tag you have used to declare that encoding, and continue to use UTF-8, resulting in the failure to read theéencoded as a single non-UTF-8 byte.You should either have your script send back a real
header('Content-Type: text/html; charset=ISO-8859-1');, which both the browser’s HTML parser andXMLHttpRequestcan understand, or — probably better — just use UTF-8 for your entire site. Then you can send any Unicode character back and forth, not just a few accented letters from Latin-1.The styling looks OK to me. The only difference I can see is the lack of font replacement on the newly-loaded content. That happens because the font replacement stuff is only run at page load time. You could call
Cufon.replace('h2');after loading the new page to do the replacement again on the new heading, or maybe consider@font-faceembedding, which is starting to take over this kind of thing.