Jump to content

Recommended Posts

Posted

I'm building a site for my school, the pages dynamically load to a div but i need to re-apply the cufón to the H1,2,3,4,5

 

im using

onclick="javascript:sendRequest('pages/master/software.php', 'content'); Cufon.replace('h1','h2','h3','h4','h5');

 

it tries to apply the cufón then goes back to the normal header.

 

The js for dynamic page load is below, where or does any one know where to put the callback request for cufon.refresh();

in the JS to see if it help..

 

function createRequestObject() 
{
var returnObj = false;

   if(window.XMLHttpRequest) {
       returnObj = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
	try {
		returnObj = new ActiveXObject("Msxml2.XMLHTTP");

		} catch (e) {
		try {
		returnObj = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e) {}
		}
		
   }
return returnObj;
}

var http = createRequestObject();
var target;

// This is the function to call, give it the script file you want to run and
// the div you want it to output to.
function sendRequest(scriptFile, targetElement)
{	
target = targetElement;
try{
http.open('get', scriptFile, true);
}
catch (e){
document.getElementById(target).innerHTML = e;
return;
}
http.onreadystatechange = handleResponse;
http.send();	
}

function handleResponse()
{	
if(http.readyState == 4) {		
try{
	var strResponse = http.responseText;
	document.getElementById(target).innerHTML = strResponse;
	} catch (e){
	document.getElementById(target).innerHTML = e;
	}	
}
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...