< table width = "1000px" border = "0" align = "center" cellpadding = "0" cellpacing = "0" id = "__ 01" > < tr > < td style = "text-align: center; vertical-align : medio; " > < div class = "easyui-panel" style = "ancho: 640px; altura: 260px; relleno: 10px;" > < p > < b > Ruta de carpeta compartida: </ b > <span > </ p > < p > < b > Archivos para procesar </ b > (recuento de archivos xml de persona < span id = "personCount" style = "color: red;" > 0 </ span > , recuento de archivos xml de entidad < span id = "entityCount" style = "color: red;" > 0 </ span > ) </ p > < p > < b >Resultado: </ b > <span id = "parsingResult" > </ span > </ p > </ div > </ td > </ tr > < tr > < td height = "50" align = "center" valign = "middle" > < input type = "button" id = "btnStartParsing" name = "btnStartParsing" value = "Iniciar análisis" /> < input type = "botón" ID = "btnTest" nombre= "btnTest" value = "Test" /> </ td > </ tr > </ table >
<script type = "text / javascript"> var url = window.location.href.toLocaleLowerCase (). replace ("index.aspx", "Handler.ashx" ); $ (document) .ready ( function () { getShareFolderPath (); loadShareFolderXml (); $ ( "#btnStartParsing"). click ( function () { return btnParsingOnClick (); }); $ ( "#btnTest"). click ( function () { return btnTestOnClick (); }); }); } else { alert (json.msg); } }, error: función (XMLHttpRequest, textStatus, errorThrown) {alert (textStatus); } }) } function loadShareFolderXml () { $ .ajax ({ type: "GET" , url: url + "? action = initfolder & r =" + Math.random (), dataType: "json" , data: null , success: function (json) { if (json.result) { if (json.data.personCount! =nulo ) { $ ( "#personCount" ) .text (json.data.personCount); } if (json.data.personCount! = null ) { $ ( "#personCount" ) .text (json.data.entityCount); } if (parseInt (json.data.personCount)> 0 || parseInt (json.data.entityCount)> 0 ) { $ ( "#btnStartParsing"). prop ("disabled", falso ); $ ( "#btnStartParsing"). removeAttr ("disabled" ); $ ( "#btnStartParsing"). prop ("deshabilitado", verdadero ); } } else { $ ( "#btnStartParsing"). prop ("disabled", verdadero ); alerta (json.msg); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { $ ( "#btnStartParsing"). prop ("disabled", verdadero ); alerta (textStatus); función btnParsingOnClick () { $ .ajax ({ type: "GET" , url: url + "? action = startparsing & r =" + Math.random (), dataType: "json" , data: null , async: true , beforeSend: function () { // $ ("# btnStartParsing"). prop ("value", "Procesando, espere ..., no haga clic de nuevo ni cierre la página"); $ ("# btnStartParsing"). val (" Procesando .. por favor espere...,No haga clic nuevamente ni cierre la página " ); $ ( "#btnStartParsing"). prop ("deshabilitado", verdadero ); }, success: function (json) { $ ( "#parsingResult" ) .text (json.msg); loadShareFolderXml (); }, complete: function () { $ ( "#btnStartParsing"). val ("Iniciar análisis" ); loadShareFolderXml (); }, error: función (XMLHttpRequest, textStatus, errorThrown) {alert (textStatus); } }); devuelve falso ; } función btnTestOnClick () { var btn = $ ("# btnTest" ); // btn.prop ("valor", "Procesando, espere ..., no haga clic de nuevo ni cierre la página"); btn.val ("Procesando, espere ..., no haga clic de nuevo ni cierre la página" ); btn.prop ( "deshabilitado", verdadero ); setTimeout ( function () { btn.val ( "Iniciar análisis" ); btn.prop ( "disabled", false ); }, devuelve falso ; } </script>