[ Index ] |
|
Code source de FCKeditor 2.4 |
1 /* 2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 3 * Copyright (C) 2003-2007 Frederico Caldeira Knabben 4 * 5 * == BEGIN LICENSE == 6 * 7 * Licensed under the terms of any of the following licenses at your 8 * choice: 9 * 10 * - GNU General Public License Version 2 or later (the "GPL") 11 * http://www.gnu.org/licenses/gpl.html 12 * 13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 14 * http://www.gnu.org/licenses/lgpl.html 15 * 16 * - Mozilla Public License Version 1.1 or later (the "MPL") 17 * http://www.mozilla.org/MPL/MPL-1.1.html 18 * 19 * == END LICENSE == 20 * 21 * File Name: fckxml_ie.js 22 * FCKXml Class: class to load and manipulate XML files. 23 * (IE specific implementation) 24 * 25 * File Authors: 26 * Frederico Caldeira Knabben (www.fckeditor.net) 27 */ 28 29 var FCKXml = function() 30 { 31 this.Error = false ; 32 } 33 34 FCKXml.prototype.LoadUrl = function( urlToCall ) 35 { 36 this.Error = false ; 37 38 var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ; 39 40 if ( !oXmlHttp ) 41 { 42 this.Error = true ; 43 return ; 44 } 45 46 oXmlHttp.open( "GET", urlToCall, false ) ; 47 48 oXmlHttp.send( null ) ; 49 50 if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) 51 this.DOMDocument = oXmlHttp.responseXML ; 52 else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) 53 { 54 this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ; 55 this.DOMDocument.async = false ; 56 this.DOMDocument.resolveExternals = false ; 57 this.DOMDocument.loadXML( oXmlHttp.responseText ) ; 58 } 59 else 60 { 61 this.DOMDocument = null ; 62 } 63 64 if ( this.DOMDocument == null || this.DOMDocument.firstChild == null ) 65 { 66 this.Error = true ; 67 if (window.confirm( 'Error loading "' + urlToCall + '"\r\nDo you want to see more info?' ) ) 68 alert( 'URL requested: "' + urlToCall + '"\r\n' + 69 'Server response:\r\nStatus: ' + oXmlHttp.status + '\r\n' + 70 'Response text:\r\n' + oXmlHttp.responseText ) ; 71 } 72 } 73 74 FCKXml.prototype.SelectNodes = function( xpath, contextNode ) 75 { 76 if ( this.Error ) 77 return new Array() ; 78 79 if ( contextNode ) 80 return contextNode.selectNodes( xpath ) ; 81 else 82 return this.DOMDocument.selectNodes( xpath ) ; 83 } 84 85 FCKXml.prototype.SelectSingleNode = function( xpath, contextNode ) 86 { 87 if ( this.Error ) 88 return null ; 89 90 if ( contextNode ) 91 return contextNode.selectSingleNode( xpath ) ; 92 else 93 return this.DOMDocument.selectSingleNode( xpath ) ; 94 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 15:28:05 2007 | par Balluche grâce à PHPXref 0.7 |