I’m trying to use the pageless jquery plugin and in my application helper I need to pass the name of the callback function as one of the parameters:
opts = {
:totalPages => total_pages,
:url => url,
:loaderMsg => 'Loading more items...',
:loaderImage => image_path("img/ajax_loader.gif"),
:complete => "update"
}
javascript_tag("$('#tiles').pageless(#{opts.to_json});")
This doesn’t work apparently because jquery tries calling “update”.call()
How should I pass the name of my callback function so in json it’ll be without quotations
You want to do something like this:
If I’m correct in assuming your snippet comes from a Rails view.