> Is it possible to run excute jquery on server side.
No, it is not possible. Unfortunately, John Resig made a mistake while designing jQuery. He assumed that the window object is always defined. This is too bad because we can't run it server side in order to manipulate the server's DOM (Drivers Of Machine)
Try to run jquery in spidermonkey and you will see for youself :
amigrave@gw /tmp/jquery [22]$ smjs jquery-1.2.1.js jquery-1.2.1.js:17: ReferenceError: window is not defined
John, if you listen, could you add support for server side AJAX (Active Java And X-Ray) ?
> No, it is not possible. > Unfortunately, John Resig made a mistake while designing jQuery. He > assumed that the window object is always defined.
I don't think that was a mistake. I'm sure if John had intended for jQuery to be used on the server, he would have designed it as such.
There are lots of server side solutions out there, as that end of the business has been worked on for many years. However client side libraries are relatively new and quite lacking IMHO, up until jQuery that is.
Imagine the bloat if jQuery were also able to run server side. I would bet that would take a lot of new functionality, although it's hard for me to even picture how that would work.
----- Original Message ----- From: "Fabien Meghazi" <a...@amigrave.com> To: <jquery-en@googlegroups.com> Sent: Saturday, December 15, 2007 2:04 PM Subject: [jQuery] Re: server side jquery
joke apart, jquery is javascript: javascript is clientside, meaning it runs in the browser visiting the website. Serverside languages are PHP, ASP, ruby on rails etc... These "serve" the data to the visitor's browser software, and that data can be html, xml, css or javascript and jquery included. but it cannot RUN or EXECUTE it.
hope this helps clarify,
Alexandre
On Dec 15, 2007 11:04 PM, Fabien Meghazi <a...@amigrave.com> wrote:
> > Is it possible to run excute jquery on server side.
> No, it is not possible. > Unfortunately, John Resig made a mistake while designing jQuery. He > assumed that the window object is always defined. This is too bad > because we can't run it server side in order to manipulate the > server's DOM (Drivers Of Machine)
> Try to run jquery in spidermonkey and you will see for youself :
> amigrave@gw /tmp/jquery [22]$ smjs jquery-1.2.1.js > jquery-1.2.1.js:17: ReferenceError: window is not defined
> John, if you listen, could you add support for server side AJAX > (Active Java And X-Ray) ?
> > No, it is not possible. > > Unfortunately, John Resig made a mistake while designing jQuery. He > > assumed that the window object is always defined.
> I don't think that was a mistake. I'm sure if John had intended for jQuery > to be used on the server, he would have designed it as such.
----- Original Message ----- From: "Kelvin Luck" <kel...@kelvinluck.com> To: <jquery-en@googlegroups.com> Sent: Sunday, December 16, 2007 2:35 AM Subject: [jQuery] Re: server side jquery
> Sharique wrote: >> Is it possible to run excute jquery on server side.
> Well, I feel silly now. Maybe jQuery + env.js + Rhino can come to my house > and do some laundry as well.
Well of course talking about jQuery server side is pointless. Now there's a context where it comes interesting. Something I would really like to see is a ruby binding to libxml with a jQuery like structure. When I have to deal with xml in a server side app, I can't stop telling me that such a module would be great.
> Well of course talking about jQuery server side is pointless. > Now there's a context where it comes interesting. > Something I would really like to see is a ruby binding to > libxml with a jQuery like structure. > When I have to deal with xml in a server side app, I can't > stop telling me that such a module would be great.
I wonder if Hpricot might be a place to start? It's made for HTML, not XML, though...
On Dec 16, 3:51 am, "Alexandre Plennevaux" <alexan...@lab-au.com>
wrote:
> hey Sharique,
> joke apart, jquery is javascript: javascript is clientside, meaning it runs
> in the browser visiting the website. Serverside languages are PHP, ASP, ruby
> on rails etc... These "serve" the data to the visitor's browser software,
> and that data can be html, xml, css or javascript and jquery included. but
> it cannot RUN or EXECUTE it.
> On Dec 15, 2007 11:04 PM, Fabien Meghazi <a...@amigrave.com> wrote:
> > On 12/15/07, Sharique <saf...@gmail.com> wrote:
> > > Is it possible to run excute jquery on server side.
> > No, it is not possible.
> > Unfortunately, John Resig made a mistake while designing jQuery. He
> > assumed that the window object is always defined. This is too bad
> > because we can't run it server side in order to manipulate the
> > server's DOM (Drivers Of Machine)
> > Try to run jquery in spidermonkey and you will see for youself :
> > amigrave@gw /tmp/jquery [22]$ smjs jquery-1.2.1.js
> > jquery-1.2.1.js:17: ReferenceError: window is not defined
> > John, if you listen, could you add support for server side AJAX
> > (Active Java And X-Ray) ?
AppJet allows you to host webapps for free, with the app written entirely in JavaScript:
----- With AppJet, you write your entire app using JavaScript, including the server logic and database. This simplifies the process of building a web app, because it lets you do everything in just one language. JavaScript is easy to learn, but still pulls its weight for advanced uses. In fact, the AppJet site itself and the AppJet framework are written in server-side JavaScript.
> > on rails etc... These "serve" the data to the visitor's browser software, > > and that data can be html, xml, css or javascript and jquery included. but > > it cannot RUN or EXECUTE it.
> In classic Asp we use server side Java/Vb Script.
Of course you can run any language server side using a virtual machine an interpreter or even compiled code. You can use asp/jscript which is the microsoft implementation of ecmascript and it can run server side.
But your question is : "Is it possible to run excute jquery on server side."
The answer could be "yes" :
Using any javascript interpreter, you can run the jquery.js file. But it will throw an error because it won't find the window object. Why is that ? Because jquery is a wonderful javascript library which give you the possibility to manipulate a web page DOM in the context of a browser (read client side). So the usage of jquery in a server side context is pointless.
Maybe it would help if you describe what you want to do.
You could start an instance of firefox (remote mode) on the server and you can control the borwser from your application. I would be interesting to know what you want to do exactly.
For you folks that want to run jQuery serverside, here's a little
teaser for a product we're releasing early in the new year, that will
allow you run jQuery server side (and much more) , we currently have
most of the jquery unit tests working, and hope that the wonderfully
active jQuery community will assist in completing those tests (some
not being relevant for that environement)
Essentially we have a page serving product that provides a full DOM
that can be manipulated by jQuery (or any JS) prior to the page being
served to the client. We think it's pretty cool.
if you want to get a ping from me when it is avail you can send me a
pm to davey at the domain aptana.com
> For you folks that want to run jQuery serverside, here's a little
> teaser for a product we're releasing early in the new year, that will
> allow you run jQueryserverside(and much more) , we currently have
> most of the jquery unit tests working, and hope that the wonderfully
> active jQuery community will assist in completing those tests (some
> not being relevant for that environement)
> Essentially we have a page serving product that provides a full DOM
> that can be manipulated by jQuery (or any JS) prior to the page being
> served to the client. We think it's pretty cool.
> if you want to get a ping from me when it is avail you can send me a
> pm to davey at the domain aptana.com