Defined in sajax.rb.
See example_multiply.rb for example.
Sajax.new([params])
Creates an object of Sajax Class. Specify parameters with a Hash to params.
sajax= Sajax.new({:debug_mode => true, :remote_uri => "server.cgi"})
params[:debug_mode]
true
to enable debug messages during JavaScript execusion.
params[:remote_uri]
params[:request_type]
params[:mb_support]
false
to disable multi-byte character support.
Arguments decoding and encoding conversion is disabled.
params[:kcode]
export(func_name) { ... }
export(func_name, proc)
export(func_name)
Exports function func_name to be called from JavaScript.
When the function is called, given block or proc.call
is executed.
How to call the functions from JavaScript? See
example_multiply.rb.
Third form is used to declare functions used in the client, in case the client and the server is separated.
handle_client_request()
If it's a function call from JavaScript, executes the function and exits.
Otherwise, does nothing.
javascript
JavaScript source code generated by Sajax.
Embed this in the <script> tag in <head>.
debug_mode
remote_uri
request_type
mb_support
kcode
Sajax.new
.