var swfu; var init_uploader = function() { swfu = new SWFUpload({ upload_script : upload_url, target : "SWFUploadTarget", flash_path : swfupload_url //many more options which you must determine for yourself - see the SWFUpload docs and examples }); swfu.loadUI(); }; //please use better handler attachment than this: window.onload = init_uploader;