source: admin/WebConsole/clases/jscripts/HttpLib.js @ df7d8f0

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since df7d8f0 was 3806a31, checked in by ramon <ramongomez@…>, 7 years ago

#834: Limpiar código JavaScript?: terminar instrucciones con ";" y evitar asignaciones duplicadas.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5630 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[3806a31]1// ********************************************************************************
2// Aplicaci�n WEB: ogAdmWebCon
3// Autor: Jos� Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
4// Fecha Creaci�n: A�o 2009-2010
5// Fecha �ltima modificaci�n: Agosto-2010
6// Nombre del fichero: consolaremota.php
7// Descripci�n : Clase para llamar p�ginas web usando metodolog�a AJAX
[3ec149c]8// ********************************************************************************
9var _url;
10var _fun;
11var oXMLHttpRequest;
12//____________________________________________________________________________
13//     
[3806a31]14//      LLama a la p�gina
[3ec149c]15//
[3806a31]16//      Par�metros:
[3ec149c]17//     
[3806a31]18//              url                     // Url de la p�gina a la que se llama
19//              fun                     // Funci�n a la que se llama despues de descargarse la p�gina
[3ec149c]20//____________________________________________________________________________
[3806a31]21function CallPage(url,prm,fun,met){
[3ec149c]22         _url=url;
[3806a31]23         _fun=fun;
[3ec149c]24
25        if (window.XMLHttpRequest) {
26                oXMLHttpRequest= new XMLHttpRequest();
27                oXMLHttpRequest.onreadystatechange = procesaoXMLHttpRequest;
[3806a31]28                oXMLHttpRequest.open("POST",_url, true);
29                oXMLHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
[3ec149c]30                oXMLHttpRequest.send(prm);   
31        } else if (window.ActiveXObject) {
32                isIE = true;
33                try {
34                  oXMLHttpRequest= new ActiveXObject("Msxml2.XMLHTTP");
35                  } catch (e) {
36                        try {
37                          oXMLHttpRequest= new ActiveXObject("Microsoft.XMLHTTP");
38                        } catch (E) {
39                          oXMLHttpRequest= false;
40                        }
41                }
42                if (oXMLHttpRequest) {
43                        oXMLHttpRequest.onreadystatechange =procesaoXMLHttpRequest;
[3806a31]44                        oXMLHttpRequest.open("POST",_url, true);
45                        oXMLHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
[3ec149c]46                        oXMLHttpRequest.send(prm);
47                }
48        }
49}
50 //_____________________________________________________________________________________
[3806a31]51 function procesaoXMLHttpRequest(){
[3ec149c]52        if (oXMLHttpRequest.readyState == 4) {
53                if (oXMLHttpRequest.status == 200) {
[3806a31]54                        var fcbk=_fun+"(oXMLHttpRequest.responseText)";
[3ec149c]55                        eval(fcbk)
56                 }
57        }
[3806a31]58}
59
Note: See TracBrowser for help on using the repository browser.