On Friday, March 27, 2015 at 8:04:14 AM UTC+13, Jothi Sankar wrote:
>
> Thanks Aria,
>
> Your response is "*clean*" and "*understandable*" and now i can get some
> clarity from your suggestions.
>
> The communication and data flow will mostly be one-directional and we
> don't need to maintain the connections between client and server. It seems
> using plan HTTP will be the wise choice.
>
> Am just curious about one thing. Hope you can help me with that.
>
> I have created a http server that renders a page with google map in it
> with the help of express and jade modules.
>
>
> app.get('/', function(req, res){
> res.render('mymap');
> });
>
>
> It is working fine. I can able to view the map and interact with it when
> access it via (http://my-host-name:IP). Lets say when the server receives
> further request like ('/location') with location information is it possible
> to add a new marker/pin on the rendered map ( without re-render / reload
> the page on server )???
>
>
>
To make a request from the browser to the server without refreshing the
page, you use XMLHttpRequest (though it has nothing to do with XML, thanks
legacy naming!) or a wrapper for it like $.ajax from jquery or any of the
other wrappers. That lets you fetch and interpret what the server sends --
you'd request JSON, usually, and the server can `res.send(jsondata)`
Or, you connect via a socket method, and the server sends the data
unsolicited after that.
In either case, then you can interpret that incoming data in the script in
the browser, and call the functions to add points to the map.
Aria
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/705f0ec0-d2ec-437a-bdfa-aeb863a0e7f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.