View previous topic :: View next topic |
Author |
Message |
tony2108 Advanced Cheater
Reputation: 0
Joined: 26 Nov 2008 Posts: 63 Location: Hacking Battlefield
|
Posted: Sat Feb 14, 2009 1:45 pm Post subject: Server-side Javascript/DOM AJAX |
|
|
Credits go to John Resig for experimenting and finding proof about server sided hacking
He made a research and worked on it all the day the results were pretty good...
Server-side Javascript/DOM
browser/DOM environment, written in JavaScript, that runs on top of Rhino; capable of running jQuery, Prototype, and MochiKit (at the very least).
The really nice touch is that you can issue PUT and DELETE requests on the XMLHttpRequest object to manipulate files on the local file system! Here's an example script that scrapes post titles from alistapart.com and stores them in a file (remember, this runs on the server like a shell script):
Code: | load("env.js");
window.location = "http://alistapart.com/";
window.onload = function(){
load("dist/jquery.js");
var str = "Newest A List Apart Posts:\n";
$("h4.title").each(function(){
str += " - " + this.textContent + "\n";
});
var out = new XMLHttpRequest();
out.open("PUT", "file:/tmp/alist.txt");
out.send( str );
}; |
Search friendly AJAX
When you load a content-empty HTML shell and fill it on the browser side with content from an XML source, you end up with a page that is essentially invisible to search engines. One workaround for this, short of having all page requests load full HTML, is to pre-render content to the page on the server side. Any content refreshing or manipulation can still be done on the client side via AJAX.
The problem with this method is that you have one code base that renders your pages on the server side, and then another Javascript code base that essentially performs the same function on the client side. It's twice the work. Twice the bug fixing too.
Imagine extending this server-side Javascript proof of concept into a general architecture for dynamic, AJAX-style sites. There's no reason why you couldn't use a Javascript library to pre-render pages as they are served and then use that exact same code to update page content on the client side.
Take this dual mode Javascript concept further and you could give all your dynamic anchor tags an href="url.html" as well as an onclick="loadFoo('url.xml')". Javascript compatable browsers can benefit from the AJAX UI features, while search engines can still navigate your documents appropriately.
Automated Testing
The other nice feature that John's hack provides is a mechanism for easily testing and debugging your Javascript code. You can code your unit tests in Javascript while writing your web apps and easily execute them against your software, just as a traditional development process would have a "make test" (or equivalent) procedure.
Other Ideas
Some other applications immediately come to mind, the most obvious being search. A robust Javascript/DOM environment added to the crawl process could make a lot of previously inaccessible content suddenly more easy for a search bot to digest.
Have any ideas or immediate uses for server-side AJAX?post here your ideas everything is useful
_________________
"Dark Angel is watching you" |
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
|
Back to top |
|
 |
SoccaBallDude Master Cheater
Reputation: 1
Joined: 29 Aug 2008 Posts: 263
|
Posted: Sat Feb 14, 2009 3:33 pm Post subject: |
|
|
tony2108 wrote: |
Credits go to John Resig for experimenting and finding proof about server sided hacking
He made a research and worked on it all the day the results were pretty good...
|
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sat Feb 14, 2009 3:35 pm Post subject: |
|
|
SoccaBallDude wrote: |
tony2108 wrote: |
Credits go to John Resig for experimenting and finding proof about server sided hacking
He made a research and worked on it all the day the results were pretty good...
|
|
As previously stated, it's preferable to link to the article as opposed to a small aside.
|
|
Back to top |
|
 |
tony2108 Advanced Cheater
Reputation: 0
Joined: 26 Nov 2008 Posts: 63 Location: Hacking Battlefield
|
Posted: Sat Feb 14, 2009 3:37 pm Post subject: |
|
|
nobody told me to do so i am new in the forums O,o
_________________
"Dark Angel is watching you" |
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Feb 14, 2009 6:24 pm Post subject: |
|
|
Keep it in mind, plagiarism is not tolerated.
|
|
Back to top |
|
 |
tony2108 Advanced Cheater
Reputation: 0
Joined: 26 Nov 2008 Posts: 63 Location: Hacking Battlefield
|
Posted: Sun Feb 15, 2009 4:16 am Post subject: |
|
|
I read the article so i know what it is about. Did you read it?
_________________
"Dark Angel is watching you" |
|
Back to top |
|
 |
|