Hey Pops,

I'm just going to address a couple of your questions for now - we can come
back to the detailed code later after it's more clear what you want to do.

First, let's call it jQuery, not JQUERY, so no one thinks you're shouting.
:-)

About catering specifically to jQuery, it's unlikely that you would do that.
If you're providing a web service, you'll use some kind of standard format
that is unrelated to a particular JavaScript library. jQuery is just
JavaScript code: anything you can do with jQuery you can do with another
JavaScript library, and vice versa. It's just a matter of how much
additional JavaScript code you need to write.

So let's talk about the web service you want to provide. What kind of code
will be the client of that service?

Code running on someone else's server? They probably want XML.

JavaScript code running in a browser? JSON is the most convenient.

JavaScript code running on a page that comes from a different domain than
yours? JSON with a callback function, often called JSONP format. You need
this to get around cross-domain browser restrictions.

You'll see a lot of web services that provide all three of those formats -
XML, JSON, JSONP - according to a parameter specified in the query string.

Before going into more detail, let's back up a bit. Could you tell us more
about the service you want to provide - not in terms of the detailed code,
but at a higher level. I got lost in the details and I don't have a good
picture of how your service will be used. I don't care at all about your
server technology (the templates and such) - that is all invisible to your
clients. More looking for how your clients will interact with the web
service. From their own server? From JavaScript in their own web pages? Or
what?

-Mike

> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Pops
> Sent: Saturday, August 11, 2007 8:09 AM
> To: jQuery (English)
> Subject: [jQuery] A few questions about JQUERY
> 
> 
> I have a few questions about implementing JQUERY.
> 
> First, I am relatively new to "WEB 2.0" methods, so please be 
> patience with what might seem to be silly questions.
> 
> I think I need to see an example of how we might be able to 
> use JQUERY or better said, how we might be able to "add" it 
> to our current framework.
> 
> I'm done alot of reading, research, etc over last 4-5 months 
> and it now it seems to me that we need to take a take back 
> into the balcony and concentrate on framing our data layer 
> with XML and/or JSON.  In short, how our backend server 
> exposes its server-side API.
> 
> I have been speading time to see how I can use JQUERY for 
> some of our current client applications, what  changes need 
> to be done, including how deep the changes.
> 
> So if I  may  illustrate a simple example today, maybe a 
> JQUERY expert can explain how we can use it (or not).  Maybe 
> it doesn't make sense, which is a concern one our 3rd party 
> developers already has expressed yesterday.  He expressed we 
> might be spending too much time on JQUERY since we must cater 
> to a wide set of tools and not get locked into one platform.
> 
> He has a good valid point, but we need to "pick one" today, 
> hopefully the "best" one, in order to offer some WEB 2.0 
> functionality in our stock client applications.
> 
> Our system is highly server-centric.  Its a RPC client/server system.
> It uses a p-code server-side scripting and template 
> technology to render output for any connected device.  It has 
> a rich API/SDK to access all the server-sider information and 
> database files.
> 
> Here is a quick Example of our code that I wish to see how I 
> can make this "JQUERY" ready.
> 
> "Who's Online" applicaiton:
> 
> A "who.htm" Web Page Template can look like this:
> 
> <table>
> <th>Node #</th><th>User Name</th><th>Time Online</th> 
> @LOOP.NODES@ <tr>
>    <td>@NODE@</td>
>    <td>@NODE.USER.NAME@</td>
>    <td>@NODE.TIME.ONLINE@</td>
> </tr>
> @ENDLOOP@
> </table>
> 
> I should note that the template was simplified here.  The 
> real who's online shows a lot more information,  connection 
> type, idle time, paging options, images, the user's current 
> activity, etc, etc, etc.  I just pick 3 fields to show per node
> 
> A server-side pcode (HTML-WHO.WCX) applet is run and it use the
> template above to render the output.   It will loop thru each node,
> and display the node#, username and time on line.  Very simple.
> 
> WCX code will look like this (pseudo code):
> 
>     dim nodes as TNodeInfo
>     GetNodes(nodes)
> 
>     Dim index as integer = 0
>     if TemplateInit("wc:\http\templates\who.htm")
>          do while TemplateExec(var)
>              select case ucase(var)
>                 case "@LOOP.NODES@"
>                    SetTemplateVar("NODE",index)
>                    SetTemplateVar("NODE.USER.NAME",
> nodes(index).user.name)
>                    SetTemplateVar("NODE.TIME.ONLINE",
> nodes(index).time.online)
>                    inc(index)
>              end select
>          loop
>     end if
> 
> The code is not complete above, like checking for the last 
> index and ending the loop,. But the main point here is that 
> the server will process this and spit it out to the browser 
> using server-side template technology.
> 
> Currently we use a META refresh to update who's online 
> display every X seconds as defined by the user.
> 
> I think this might be a good example for AJAX and JQUERY but 
> it seems I am spending too much time learning the new JQUERY 
> "language."  I am not 100% clear how things are done.
> 
> I think, and this is more of a question, I think I need to 
> first create a new WCX that creates XML or JSON output only 
> to begin to take advantage of JQUERY.  Then second, I need to 
> "bind" if that is the proper JQUERY term, the JSON fields 
> with a Table columns.
> 
>     - Create a WCX "web service" that returns JSON (or XML) output
>     - Bind the JSON fields with the Display fields.
> 
> Does that sound correct?
> 
> If I can see a quick example of how JQUERY will be 
> conrstructed, in particular having it do:
> 
>        - Periodic Ajax Calls
>        - Bind the JSON result to table elements
> 
> then that will go a long way to completing this examination.
> 
> Note: I have explored other AJAX frameworks, such as SPRY, 
> and it had good examples that I can relate to using similar 
> "template looping ideas" but in SPRY's case, it uses 
> client-side template processing.
> One concern I had was that I did see some client side 
> performance hits  when we apply SPRY to another potential 
> application where large results are returned. In our 
> server-side template driver model, the data is cached at the 
> server and and paged by the browser.
> 
> These is all pretty much standard design considerations.  I 
> just hope I can see how its done with JQUERY.
> 
> I would appreciate any comments/input you may have.
> 
> TIA
> 
> ---
> HLS
> 

Reply via email to