possibility to save data with javascript?

hey,

is in ruby on rails possibility to save data with javascript?

for example to call a controller/action with parameters from a
javascript?

thank you.

andi

hey,

is in ruby on rails possibility to save data with javascript?

for example to call a controller/action with parameters from a
javascript?

Well it's not rails specific at all (ie. it's just bog standard client
side stuff) but you can make an ajax request from your javascript. The
easiest way to get started would be to read up about that in whatever
javascript library you're using (prototype, jquery, mootools etc.)

Fred

hello robert,

i tried test this:

function saveNode() {
var lat = document.getElementById("jsla").value;
var lng = document.getElementById("jslg").value;
var getVars = "?node[lat]=" + lat
+ "&node[name]=" + document.getElementById("jsname").value +
'_savetest'
+ "&node[lng]=" + lng
+ "&node[id]=" + "55"
+ "&authenticity_token=";
var request = GXmlHttp.create();
//call the create action back on the server
request.open('GET', 'create' + getVars, true);

}

do you know, how i can get the authenticity_token and why there is no
answer from the server?