I'll check out DashCode in the meantime. By the way, how do you link DashCode to fpc? There doesn't seem to be much on that on the web. Thks.
You can probably use just about any server-side approach you want. I've tested Dashcode with PHP, ASP and Pascal. ExtPascal's FCGIApp unit has been split off from the UI stuff, so you can use it without using ExtJS. (I seem to recall that it was added to fcl-web or something like that too.)
Here's a simple example of calling a Pascal app on the server via Ajax from the browser:
Event handler in Dashcode main.js:
function xmlLoaded(xmlRequest)
{
if (xmlRequest.status == 200) {
// Parse and interpret results
// XML results found in xmlRequest.responseXML
// Text results found in xmlRequest.responseText
eval(xmlRequest.responseText);
}
else {
alert("Error fetching data: HTTP status " + xmlRequest.status);
}
}
function button1Click(event)
{
var feedURL = "
http://localhost/cgi-bin/cgigateway.cgi?Name=text1";
var onloadHandler = function() { xmlLoaded(xmlRequest); };
var xmlRequest = new XMLHttpRequest();
xmlRequest.onload = onloadHandler;
xmlRequest.open("GET", feedURL);
xmlRequest.setRequestHeader("Cache-Control", "no-cache");
xmlRequest.send(null);
}
Pascal code fragment that responds to Ajax request:
uses
FCGIApp;
type
TAppThread = class(TWebSession)
published
procedure Home; override;
end;
implementation
procedure TAppThread.Home;
begin
Response := 'document.getElementById("' + Query['Name'] + '").innerText = "Hello, again";';
end;