Hi,
Would anyone be able to suggest why the following works in the action
but not when placed in a .js file, called by the action?
It’s the page << “$(‘basket_popup’).popup.show();” line I’m interested
in.
def show
respond_to do |format|
format.js do
render :showbasket do |page|
page << "$('basket_popup').popup.show();"
end
end
end
end
However when I have show.js and remove the block from format.js it
fails. I get a javascript error on the page along the lines of popup
has no properties/attributes?
-show.js-
page << “$(‘basket_popup’).popup.show();”
I’m sure it’s a simple one but I can’t see it??