Ajax Pages - Project Started

G

Gustavo Amigo

Hi,

i´ve started a project on sourceforge. It´s called Ajax Pages, it´s
a scripting template engine that enables rapid development of Ajax
Web-based Applications. I would like you guys to take a look and give
me some feedback on it . It´s just a start, but there are already some
pretty good examples.

http://ajax-pages.sourceforge.net/index.html

Thanks,
[]´s
Gustavo Amigo
 
M

Matt Kruse

Gustavo said:
i´ve started a project on sourceforge. It´s called Ajax Pages, it´s
a scripting template engine that enables rapid development of Ajax
Web-based Applications. I would like you guys to take a look and give
me some feedback on it .

I don't really understand the value that it adds. But aside from that, I
have two comments after scanning the code for 2 seconds:

1) You use eval. Don't.

2) This code below seems highly fragile. Why is one branch async and the
other not? You're not handling onreadystatechange or anything for async
requests, which means this code will most certainly break. Your underlying
Ajax communication layer definitely needs to be more robust.

AjaxPages.prototype.load = function ( url ) {
var req;
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.open("GET", url, true);
req.send();
}
}

this.template = req.responseText;
return req.responseText;
}
 
G

Gustavo Amigo

First of all, thanks for the reply.

I totally agree with you about the robustness underlying communication.
I´ve been working on this code for a week and there are many points of
improvement. The first thing i want to do is make everything
assyncronous. I don´t understand what is the problem of eval, can you
clear that point for me?

About the value that it adds, it´s just a personal thought. But i come
from the Java world where the MVC pattern is used everywhere.
Implementing the MVC pattern with Javascript seemed to me
non-productive because it´s hard to work in a productive way
manipulating DOM dircectly. A client-side template language can make
the View Component of a MVC implementation very productive. For
example, i added a blog example to the project. It was implemented in a
matter of hours.

Gustavo Amigo
 
Z

Zif

Gustavo said:
Hi,

i´ve started a project on sourceforge. It´s called Ajax Pages, it´s
a scripting template engine that enables rapid development of Ajax
Web-based Applications. I would like you guys to take a look and give
me some feedback on it . It´s just a start, but there are already some
pretty good examples.

http://ajax-pages.sourceforge.net/index.html

Thanks,
[]´s
Gustavo Amigo

Your blog demo page source starts:

<!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" xml:lang="en" lang="en">
<head>
<title>Ajax super blog</title>
<link href="style.css" type="text/css" rel="stylesheet">
<script language="javascript" src="../../src/AjaxPages.js"></script>
<script language="javascript">
<!--

....

The language attribute is depreciated, type is required.

Putting "comment" tags ( <!-- --> ) inside a script element in an XHTML
page may cause the user agent to delete or ignore everything between the
tags - which is why such usage is discouraged always.

Either put all scripts in external files or use:

<script type="text/javascript">
<![CDATA[
... unescaped script content ...
]]>
</script>


<URL:http://www.w3.org/TR/xhtml1/#h-4.8>
 
T

The Magpie

Zif said:
Gustavo said:
i´ve started a project on sourceforge. It´s called Ajax Pages, it´s
a scripting template engine that enables rapid development of Ajax
Web-based Applications. I would like you guys to take a look and give
me some feedback on it . It´s just a start, but there are already some
pretty good examples.

http://ajax-pages.sourceforge.net/index.html
[snip]
Putting "comment" tags ( <!-- --> ) inside a script element in an XHTML
page may cause the user agent to delete or ignore everything between the
tags - which is why such usage is discouraged always.
Rather than simple Ajax, you might want to take a look at OpenLaszlo,
which fits perfectly into the Ajax format and is based on a compiled
(yes, compiled) set of Flash tool widgets that can be delivered to web
pages direct. You can find details at http://www.openlaszlo.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top