1) CODE TITLE: DHTML CrossBrowser Ajax Simulator / Photo Uploader
2) AUTHOR NAME/NOTES: Tony Ogundipe
3) DESCRIPTION: Demonstrating How To Upload Files With My New Ajax Simulator. It can also be used to submit any form no matter how large in an ajax-like manner.
Unlike ajax, it has no limit to the size or the content of the form, so can upload 100 pictures or whatever your server can handle. Online demo can be found:
4) URL TO CODE: http://www.mwebng.net?net=dl
Online demo: http://www.mwebng.net/demos/jupload/
The main code engine however is:
Code:<script> function sendData(form,s) { var d=document.createElement('DIV'); document.body.appendChild(d); d.style.cssText+="width:100%;height:50px;display:none"; var sid="frame_"+Math.random()+"_"+Math.random( ); d.innerHTML="<iframe width='100%' name='"+sid+"' height='50'></iframe>"; var l=document.getElementsByName(sid);var frm=l[l.length-1]; var timerx=setInterval( function() { if(frm.contentWindow.location.href.indexOf("http://")==0) { clearInterval(timerx); var response={title:'title',location:'location',innerHTM:'innerHTML'}; response.location=frm.contentWindow.location.href; response.title=frm.contentWindow.document.title; response.innerHTML=frm.contentWindow.document.body.innerHTML; response.window=frm.contentWindow; response.document=frm.contentWindow.document; s(response); } },500 ); form.target=sid;form.submit(); } </script>



Reply With Quote

Bookmarks