Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var xmlHttp
- var xmlHttp
- function deleteFile() --Invoked on clicking of the delete button
- {
- if (typeof XMLHttpRequest != "undefined")
- {
- xmlHttp= new XMLHttpRequest();
- }
- else if (window.ActiveXObject)
- {
- xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");
- }
- if (xmlHttp==null)
- {
- alert("Browser does not support XMLHTTP Request")
- return;
- }
- var url="deleteFile.jsp?DelNum="+document.getElementById("Numid").value+"&DelName="+document.getElementById("ActualNameid").value;
- xmlHttp.onreadystatechange = stateChange;
- showLoading();
- xmlHttp.open("GET", url, true);
- xmlHttp.send(null);
- }
- function stateChange()
- {
- if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
- {
- document.getElementById("deleteButton").innerHTML=xmlHttp.responseText;
- hideLoading();
- }
- }
- function showLoading() {
- $("#appear").show();
- }
- function hideLoading() {
- $("#appear").hide();
- }
- </script>
- <div id="ParentDiv">
- Few other buttons
- <div id="deleteButton"> --This is enabled by default
- Delete Button Goes Here
- </div>
- <div id="Appear"> --This is hidden by default
- Deleting...<img src="ajax-loader.gif" />
- </div>
- </div>
- #Appear{
- display:inline;
- }
- #DeleteButton
- {
- display:inline;
- }
Add Comment
Please, Sign In to add comment