|
Write a comment |
Articles |
DHTML Gallery |
.NET |
MyBlog |
About Me |
FAQ
|
|
|
Doing AJAX with popular javascript libraries
| Basic | Prototype.js | Dojo Toolkit | Yahoo UI Library | ASP.NET | Rails |
DojoToolkit
<script language="javaScript"
type="text/javascript" src="js/DOJO/dojo.js">
dojo.require("dojo.io.x.*");
dojo.require('dojo.event.*');
dojo.io.bind({
url: "your_URL",
load: function(type, data, evt){ alert(data); },
error: function(type, error){ alert('There was a problem'); },
mimetype: "text/plain"
});
</script>
The mimetype 'text/plain' indicates we expect plain text or JSON response. The rest looks self-explanatory and somewhat similar to prototype's implementation. Another interesting thing which it does is , submitting of HTML forms via AJAX <form name="pwd_verify" id="pwd_verify" method=post> <input name="nam" type=text /> <input name="pwd" type=password /> </form>
dojo.io.bind({
url: "http://ashishware.com/password.cgi",
load: function(type, evaldObj){ alert(evaldObj); },
formNode: document.getElementById("pwd_verify")
});
There is one more interesting thing, 'File Upload without Files'. Yes this may sound strange, what it means you send some data, with contenty-type and filename .
| Basic | Prototype.js | Dojo Toolkit | Yahoo UI Library | ASP.NET | Rails | |
| Copyright (c) 2007-2011 Ashish Patil . Please read FAQ for more details. |