Well, not excatly an umbraco question, but the solution i'm making it in is umbraco, and i can't seem to find out what causeing the error. Let's get into it.
I have a simple ajax script there loads in childnodes of a page, the childnodes have got a cufon header, issue is i can't get the cufon to "refresh" after the content is loaded into the div - well it works in ie, but ff, chrome & opera don't register the refesh, iv'e googled everything about this issue but haven't found anything i can use.
I think there might be a problem with the order of things. If the Cufon font replacement is run after the AJAX load it won't work. I usually solve these problems using a callback on the AJAX load that is triggered via a callback function after the new AJAX content has been loaded. But I can see you have already tried this.
Is the function where you load the AJAX content (geturl) inside or outside the document ready scriptblock? If it's outside it's probably run after the Cufon replacements. Difficult to tell what is happening just by looking at the code snippets.
If you have FireBug installed, try inserting some console.log statements in the different functions to see when they are triggered.
I've had problems with this as well in the past, I've solved it exactly as Thomas has, by using a callback function, than calls Cufon.replace() on the elements that are refreshed. Be careful though, calling Cufon.replace() on items that are already replaced can cause some funkyness, so make sure to only update those elements that are affected by your ajax call.
If you're using jQuery (it looks like you are) you might also want to check out liveQuery. It can be used to bind jQuery methods to elements generated through AJAX calls.
After trying everything there is to try with cufon, ajax & jquery i finnaly found the solution. If anybody get's this problem in the future i fixed it by
Cufon+Ajax
Hi guys
Well, not excatly an umbraco question, but the solution i'm making it in is umbraco, and i can't seem to find out what causeing the error.
Let's get into it.
I have a simple ajax script there loads in childnodes of a page, the childnodes have got a cufon header, issue is i can't get the cufon to "refresh" after the content is loaded into the div - well it works in ie, but ff, chrome & opera don't register the refesh, iv'e googled everything about this issue but haven't found anything i can use.
My Ajax
I've tried following solutions but none of the work
$("#"+containerdiv).load(myurl, Cufon.refresh);
Hope somebody can help me find an solution for this.
Hi!
I think there might be a problem with the order of things. If the Cufon font replacement is run after the AJAX load it won't work. I usually solve these problems using a callback on the AJAX load that is triggered via a callback function after the new AJAX content has been loaded. But I can see you have already tried this.
Is the function where you load the AJAX content (geturl) inside or outside the document ready scriptblock? If it's outside it's probably run after the Cufon replacements. Difficult to tell what is happening just by looking at the code snippets.
If you have FireBug installed, try inserting some console.log statements in the different functions to see when they are triggered.
Regards,
Thomas Kahn
I've had problems with this as well in the past, I've solved it exactly as Thomas has, by using a callback function, than calls Cufon.replace() on the elements that are refreshed. Be careful though, calling Cufon.replace() on items that are already replaced can cause some funkyness, so make sure to only update those elements that are affected by your ajax call.
If you're using jQuery (it looks like you are) you might also want to check out liveQuery. It can be used to bind jQuery methods to elements generated through AJAX calls.
Thank you for your response everybody, i'll try inserting some console.log, and also checking out the liveQuery.
Oh and if anybody would get the crasy thought of looking further into it the problem can be viewed here
http://bonesupport.fserver.dk/company/who-we-are/management.aspx
Any help is appreciated :)
I'm on the top of the world :)
After trying everything there is to try with cufon, ajax & jquery i finnaly found the solution. If anybody get's this problem in the future i fixed it by
in umbraco i load childnodes into the topnode so in the childnode template i need to acivate cufón when the childnode is loaded.
simply add this to the bottom of your page/html being loaded into your div
my solutions
first go to Cufon
second : in <head> add for example for Museo font:
and before closing BODY TAG </body> add that line :
i hope it will work for you
Regards
is working on a reply...