[geeks] javascript tutorial sought?

Joshua Boyd jdboyd at jdboyd.net
Tue Aug 12 09:43:32 CDT 2008


On Tue, Aug 12, 2008 at 10:13:42AM -0400, der Mouse wrote:
> >> I want to build a card-game client [in javascript].
> 
> > Do you understand javascript the language, networking and images
> > aside?
> 
> I don't know.  I think I mostly have a handle on it, but I could be
> deluding myself.

You probably have a handle on it.  Networking isn't part of the language
anyway. 
 
> > First, you can't open arbitrary network connections in the web
> > browser.  You can only open http connections to the server that
> > delivered the web page.
> 
> Only HTTP, or only port 80?  If the former, how much do they have to
> look like HTTP?  The webpage you cite makes it appear RPCish, which
> would be..ugly..to turn into what I'm after.  (I really don't want to
> have to layer TCP atop HTTP, especially since it's not clear there's
> any way for the server to get the client's attention asynchronously.)
> 
> I basically want to turn the web browser into a (very specialized)
> "termnial emulator" designed to support card games rather than text
> "console" applications.  Perhaps JavaScript is a wrong approach?

You are correct that there is no way for the server to get the client's
attention asynchronously.

Also, only HTTP, but I don't think it has to be port 80.

It is somewhat RPCish.  It doesn't have to be RPC specifically (it just
just be grabbing static content via the XMLHttpRequest), but it
generally is an RPC.

If you don't want to rethink your protocol to fit over HTTP, then I'm
not sure what to recommend.  You could always do something with Python
and PyGame, and it would run on Windows, but I don't know that you'd be
able to package it up into an Exe without a Windows machine handy.  

Otherwise, Java is the only way I can think of to develop for Windows
without ever touching a Windows machine.
 
> > If at all possible, I'd stick with using CSS, even if that means
> > pre-rendering a bunch of sprites.
> 
> I currently have _no_ handle on CSS.  Perhaps I need to change that.

You probably will need CSS to do it this way.  Sorry.  If you aren't
familiar, with DOM, you will probably need that as well.
 
> > None of the books I've looked at have really been targeted as
> > Javascript for People Who Already Know Lisp/Python/Other Dynamic
> > Language And Just Want To Know How To Do The Cool Stuff Rather Than
> > Treat As A Dumbed Down Language.
> 
> Yeah, that sounds like what I want. :)  I found a couple of webpages
> that (thought they) were "javascript tutorial for programmers" things,
> but they still gave only the basics.  Slightly more than the
> "javascript tutorial for total ignorami" ones, but still not enough to
> be useful to me.
> 
> > Of course, that would make an awful title anyway.
> 
> :-)



More information about the geeks mailing list