AJAX & Parsing


So i cant load php files with that, it returns them as plain text instead of parsing the data.

So i used a html file with a JavaScript function to use AJAX with a POST call. Again, it does not work, it returns the ajax file as plain text.

Am i missing a step or will this system not work with basic AJAX?

JavaScript function

<script type="text/javascript">
function loadList()
	var params = '&m=lpt';
	try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch(e) {
	try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch(oc) { req = null; }
	if (req == null && typeof XMLHttpRequest != "undefined") 
		req = new XMLHttpRequest();
	if (req != null) 
		req.open("POST", 'ajax.php', true);
		req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		req.setRequestHeader("Content-length", params.length);
		req.setRequestHeader("Connection", "close");
		req.onreadystatechange = function() {if (req.responseText != '') { document.getElementById('List').innerHTML = req.responseText;}};


<input type="button" value="load patients" onclick="loadList();" />
<div id="List" style="height:100%">...</div>


if ($_POST['m'] == 'lpt')

So simple of a request, now the List.php file connects to a database and prints out all of the data, so it is basic functions. This script returns the actual code from the AJAX(PHP) section, as plain text.

How do you go about executing it? Is simple stuff to trivial for the high-tech products?

Also i have tried appending the “, true” to the attachURL.

Sidenote, i didn’t mention which product, this is the dhtmlxWindows

Also i have tried appending the “, true” to the attachURL.

this approach must mork, as attachURL(url,true) loads data using Ajax and executes the script in the tags.

Could you provide the example of problematic content that attachURL(url,true) doesn’t load ?

I already did in my first post…

The loadList function calls ajax.php
Question: Can that be done with this?

The ajax.php file includes another php file, which prints the information
Question: Can that be done with this?

Will the ajax only work with HTML, not PHP? If so, what is the point? If you want to return database values or do permissions checks, etc… on the data you are returning, you cant do this with Javascript, that is what AJAX was invented for!

Is your “AJAX” support limited to just HTML/Javascript? If so, i dont think it should say there is AJAX support in it.

Ok, so after awhile of moving and testing, it is because it is on my local machine. You should add a check somewhere for that?

Will the ajax only work with HTML, not PHP?

It works with php - dhtmlx.com/docs/products/dht … quest.html

I asked sample without server-side script, as it is easier for testing.