Zum Inhalt springen

Probleme mit xajax im ie

Erstellt am 21. September 2009 · 2 Antworten · letzte Antwort am 22. September 2009

Tags: JavaScript & AJAX, Frage

xraysoft ·

Hallo,

folgendes Problem, ich habe in meine eigene Extension xajax integriert und im Firefox ist auch alles wunderbar, aber im IE bekomme ich bei jedem Request eine Fehlermeldung (Error: the XML response that was returned from the server is invalid).
Ich habe so eine Vorahnung das es sich hier bei um den Charset handelt, bin mir aber nicht sicher. Eigentlich habe ich auf der ganzen Seite utf-8 als Charset gesetzt, damit sollte xajax eigentlich funktionieren.

Hier mal meine main-Funktion

function main($content, $conf) {
		// Loading TypoScript array into object variable:
		$this->conf = $conf;
		// Loading language-labels
		$this->pi_loadLL();
		// Make the plugin not cachable
		$this->pi_USER_INT_obj = 1;
		// Initialise the return variable
		$this->map = unserialize($GLOBALS['TSFE']->TYPO3_CONF_VARS['EXT']['extConf'][''.$extKey.'']);
		if($conf['simpleTemplate'] != '') {
			$this->templateSimple = $this->cObj->fileResource(''.$conf['simpleTemplate'].'');
		} else {
			$this->templateSimple = $this->cObj->fileResource('EXT:iw_salesdepartments/simpleview.html');
		}
		$content = '';
		$sForm = '';
		$sFormResult = '';
		/*********************************************************************************
		*  Instantiate the xajax object and configure it
		*********************************************************************************/
		// Include xaJax
		require (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');
		// Make the instance
		$this->xajax = t3lib_div::makeInstance('tx_xajax');
		// Decode form vars from utf8
		$this->xajax->decodeUTF8InputOn();

		// Encoding of the response to utf-8.
		$this->xajax->setCharEncoding('utf-8');

		// To prevent conflicts, prepend the extension prefix.
		$this->xajax->setWrapperPrefix($this->prefixId);
		// Do you want messages in the status bar?
		$this->xajax->statusMessagesOn();
		// Turn only on during testing
		$this->xajax->debugOn ();
		// Register the names of the PHP functions you want to be able to call through xajax
		// $xajax->registerFunction(array('functionNameInJavascript',&$object,'methodName'));
		$this->xajax->registerFunction(array('processFormData', &$this, 'processFormData'));
		// If this is an xajax request call our registered function, send output and exit
		$this->xajax->processRequests();
		// Else create javacript and add it to the normal output
		$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));
		// The form goes here
		$content .= $this->sGetForm();
		// The result box goes here: #formResult
		/*if (!$this->piVars) { 
			// We make an empty result box on the first call to send our xajax Responses to
			$content .= '<div id="formResult"></div>';
		} else {
			// This Fallback will only be used if JavaScript doesn't work.
			// Responses of xajax exit before this.
			$content .= sprintf( '<div id="formResult">%s</div>', $this->sGetFormResult());
		}*/
		if($this->map['enableMaps'] == 0) {
			$content .= $this->getSimpleView();
		} else if ($this->map['enableMaps'] == 1) {
			$content .= $this->getMapView();
		} else {
			$content .= htmlspecialchars($this->pi_getLL('noconfig'));
		}
		return $this->pi_wrapInBaseClass($content);
	} // function main($content, $conf)

Ich hoffe von Euch hat jemand eine Idee, habe schon sämtliche Zeichenketten-Variablen versucht mit diversen php-Tags umzuwandeln (z.B. htmlentities($variable), htmlspecialchars($variable) und strip_tags(utf8_decode($variable)) ) hatte alles keine Auswirkung auf die Fehlermeldung. Habe mich auch nun schon einige Zeit durch einige Foren und Google gesucht, habe aber leider keinen passenden Beitrag gefunden.