KBD

Keith Devens .com

Saturday, March 20, 2010 Flag waving
Got truth decay? Brush up on your Bible! – a billboard in New Brunswick, NJ
← The VP debateWith John Kerry it really *would* have been the coalition of the bribed and coerced! →

Daily link icon Wednesday, October 6, 2004

ScriptServer - client/server communication between Javascript and PHP

Harry Fuecks has something that looks really cool. ScriptServer (Via Adam):

ScriptServer provides tools to "hook up" PHP and Javascript, for the purpose of fetching data from PHP into a web page which has already loaded, without reloading the entire page.

The objective is to make connecting a Javascript client with a PHP server as painless and error-free as possible. To this end ScriptServer allows you to define a class in PHP and call it’s methods directly (and remotely) from Javascript.

Looks like it uses XML-RPC from JS to PHP. Neat! Nope, it passes back and forth native evallable or unserializable data particular to PHP or JS. Excellent! Who needs XML?

← The VP debateWith John Kerry it really *would* have been the coalition of the bribed and coerced! →

Comments XML gif

Harry Fuecks (http://www.phppatterns.com) wrote:

Thanks for the announce. Think I'm confusing everyone because the Sourceforge site also has a fork of Simon's XML-RPC implementation (hence the site's name).

ScriptServer actually sends strings to PHP (from Javascript) ready for unserialize() while in the opposite direction it generates Javascript wrapped in an anonymous function e.g. response from Colors::listColors - on the Javascript side use eval to "unserialize" the response. Basically uses inbuilt parsers already available in PHP and Javascript; parsing (e.g. XML) is usually alot harder than generating.

∴ Harry Fuecks | 6-Oct-2004 3:27am est | http://www.phppatterns.com | #5804

Keith (http://keithdevens.com/) wrote:

Even better! Who needs XML? Kick ass. Now I need an app to try this out on.

Keith | 6-Oct-2004 3:29am est | http://keithdevens.com/ | #5805

Tim Wood wrote:

It all sounds wonderful and good. Problems:

1) The docs linked above don't link to the .zip file they refer (the one with the nifty server code). There are .tar.gz files at sourceforge.net/projects/xmlrpccom/

2) The sample code in the docs have lots of missing quotes.

3) Once I was able to fix all the problems I could find, The basic example in the quick start part still wouldn't work.

I suspect it'll be a great tool when you don't spend an hour plus with the quickstart and still not even have a working 'hello world' app. But, till then I'm going to make do with the code I found over at www.paranoidfish.org/boxes/2002/01/30/

∴ Tim Wood | 23-Oct-2004 1:12pm est | #6015

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.113s.

(Used 8 db queries)