All pastes #770806 Raw Edit

Stuff

public javascript v1 · immutable
·published 2007-11-12 16:33 UTC
rendered paste body
<script type="text/javascript">	function ajax_Lead_FileUpload()	{		$("#loading")		.ajaxStart(function(){			$(this).show();		})		.ajaxComplete(function(){			$(this).hide();		});				document.getElementById("lead_image_top_menubar").style.display= "block";		document.getElementById("form_lead_image").style.display= "none";				$.ajaxFileUpload		(			{				url:'<?php echo "http://". $_SERVER['HTTP_HOST'] ."/functions/doajaxfileupload_lead.php" ?>',				secureuri:false,				fileElementId:'fileToUpload_Lead',				dataType: 'json',				success: function (data, status)				{					if(typeof(data.error) != 'undefined')					{						if(data.error != '')						{							alert(data.error);						}else						{																				//alert(data.url);							//alert(data.msg);							//alert(data.photoid);							//alert(data.name);														var li_0 = document.createElement('li');							li_0.value = data.photoid;														var a_0 = document.createElement('a');							a_0.href = data.url;							a_0.appendChild( document.createTextNode(data.name) );							li_0.appendChild( a_0 );														//														var div_0 = document.createElement('div');							div_0.className = "right_checkbox";														var input_remove_image = document.createElement('input');							input_remove_image.onchange = function(){															document.getElementById("form_lead_image").style.display= "block";							document.getElementById("lead_image_top_menubar").style.display= "none";														var test = data.photoid;										alert(test);																					};							input_remove_image.value = 1;							input_remove_image.name = "remove_image";							input_remove_image.id = "remove_image";							input_remove_image.type = "checkbox";							div_0.appendChild( input_remove_image );														li_0.appendChild( div_0 );																																							    document.getElementById('selected_lead_image').appendChild( li_0 );														var submit_form = document.getElementById('form_lead_image');																				var total_nodes = document.getElementById('form_lead_image').childNodes.length;														node_name = "leadimage_" + total_nodes;							image_id = data.photoid;																												lead_image = document.createElement("input");							lead_image.setAttribute("name", node_name);							lead_image.setAttribute("type", "hidden");							lead_image.setAttribute("value", image_id);														submit_form.appendChild( lead_image );																																									}					}				},				error: function (data, status, e)				{					alert(e);				}			}		)				return false;	}</script>