source: admin/WebConsole/clases/jscripts/HttpLib.js @ 2c1b0cf

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-instalacion
Last change on this file since 2c1b0cf 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
Line 
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
8// ********************************************************************************
9var _url;
10var _fun;
11var oXMLHttpRequest;
12//____________________________________________________________________________
13//     
14//      LLama a la p�gina
15//
16//      Par�metros:
17//     
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
20//____________________________________________________________________________
21function CallPage(url,prm,fun,met){
22         _url=url;
23         _fun=fun;
24
25        if (window.XMLHttpRequest) {
26                oXMLHttpRequest= new XMLHttpRequest();
27                oXMLHttpRequest.onreadystatechange = procesaoXMLHttpRequest;
28                oXMLHttpRequest.open("POST",_url, true);
29                oXMLHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
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;
44                        oXMLHttpRequest.open("POST",_url, true);
45                        oXMLHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
46                        oXMLHttpRequest.send(prm);
47                }
48        }
49}
50 //_____________________________________________________________________________________
51 function procesaoXMLHttpRequest(){
52        if (oXMLHttpRequest.readyState == 4) {
53                if (oXMLHttpRequest.status == 200) {
54                        var fcbk=_fun+"(oXMLHttpRequest.responseText)";
55                        eval(fcbk)
56                 }
57        }
58}
59
Note: See TracBrowser for help on using the repository browser.