[CODE]
var holder = document.getElementById(‘article’),
state = document.getElementById(‘status’);
if (typeof window.FileReader === ‘undefined’)
{
state.className = ‘fail’; }
else
{
state.className = ‘success’;
state.innerHTML = ‘File API & FileReader available’;}
holder.ondragover = function () { this.className = ‘hover’; return false; };
holder.ondragend = function () { this.className = ”; return false; };
holder.ondrop = function (e) {
this.className = ”;
e.preventDefault();
var file = e.dataTransfer.files[0],
reader = new FileReader();
reader.onload = function (event) {
var Img_Src =event.target.result;
document.execCommand(‘InsertImage’,null,Img_Src);
var xmlhttp;
if (window.XMLHttpRequest)
{ xmlhttp=new XMLHttpRequest(); }
else
{
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”); }
xmlhttp.onreadystatechange=function()
{
document.getElementById(‘condition_return’).innerHTML=xmlhttp.responseText;}
xmlhttp.open(“POST”,”index_services/upload.php”,true);
xmlhttp.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded”);
xmlhttp.send(“send=” + Img_Src + “&page_pointer=$page_pointer&key=$fetch_user_session_data[0]”); };
reader.readAsDataURL(file);
return false; };
ondragend and ondragover brakes the normal d&d of the images already in place and prevents dropping web images. i am new to javascript and am trying to complete a cms that is all done except for the client interface(this code) i am not afraid of looking dumb so let me hear it, please oh please. what am i doing wrong and/or could i do better. thx in advance(very very much).