1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Flash doesn't load

Discussion in 'JavaScript' started by gilgalbiblewheel, Jan 16, 2010.

  1. #1
    I don't understand why my swf files doesn't load when I use AJAX (or is the problem something else?):
    The website is here but you have to click View my latest works on the left side bar.
    But on a separate page, it works (here)
    function createRequest(){
    	var req = false;
    	try {
    		req = new ActiveXObject('Msxml2.XMLHTTP');
    	}catch (e2){
    		try{
    			req = new ActiveXObject('Microsoft.XMLHTTP');
    	}catch(e3){
    		try{
    			req = new XMLHttpRequest();
    	}catch(e1){
    			req = false;
    			}
    		}
    	}
    	return req;
    }
    function myLatestWorks(){
    	var req = createRequest();
    	if(req){
    		req.onreadystatechange = function(){
    			if(req.readyState){
    				if(req.readyState == 4){
    					if(req.status == 200){
    						var newDiv = document.createElement("div");
    
    						newDiv.setAttribute('id', 'latestworks');
    						newDiv.innerHTML = req.responseText;
    						// And then inject it:
    						document.body.appendChild(newDiv);
    						//document.write(newDiv.innerHTML);
    					}
    				}
    			}
    		}
    	req.open("GET","flashclips/portfolioupdates.php",true);
    	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    	req.send(null);
    	}
    }
    Code (markup):

     
    gilgalbiblewheel, Jan 16, 2010 IP