Hallo,
Ich habe versucht die antwort zu finden, bin aber nicht fundig geworden, obwohl die frage wohl haufiger vorkommen koennte...
Ich versuche, eine AJAX componente zu erstellen, und habe das problem dass mit meiner eigentlicher antwort gleich das ganze joomla rahmen mitgeschickt wird, obwohl ich nur ein string kriegen will. Wie kann man es machen, dass dabei keinen rahmen mitkommt?
Meine PHP sieht so aus:
und meine XML sieht so aus:PHP-Code:<?php
defined( '_VALID_MOS' ) or
die( 'Direct Access to this location is not allowed.' );
echo 'That product is in stock!';
?>
HTML-Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta **********="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" language="javascript"> // Create XML request variable var myRequest = false; function displayAjax(myURL) { // Clear myRequest myRequest = false; // For browsers: Safari, Firefox, etc. use one XML model if (window.XMLHttpRequest) { alert("xml request out"); myRequest = new XMLHttpRequest(); if (myRequest.overrideMimeType) { myRequest.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // For browsers: IE, version 6 and before, use another model try { myRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { myRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } // Make sure the request object is valid if (!myRequest) { alert('Error: Cannot create XMLHTTP object'); return false; } // Link to display function activated when result returned myRequest.onreadystatechange = displayReturn; // Open the URL request myRequest.open('GET', myURL, true); // Send request myRequest.send(null); } function displayReturn() { // Check to make sure result came through, 4=complete if (myRequest.readyState == 4) { // Check HTTP status code if (myRequest.status == 200) { // Display the responseText alert(myRequest.responseText); } else { alert('There was a problem with the request.'); } } } </script> </head> <body> <p style="border:1px solid black;" onmouseover="displayAjax('http://www1.in.tum.de/static/dolli/index.php?option=com_productinfo&format=raw')"> My Product </p> </body> </html>


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen