javascript - application-wide jquery script -
i use facebook js scripts user authentification, etc. want place them in unobtrusive way application-wide scripts.
currently have script partial , call application header:
<%# render 'layouts/facebook_app_scripts' %>
the script works extremely obtrusive. want make unobtrusive. important since tap sorts of apis , it's getting messy.
you don't need see in entirety (if need see script answer question, don't think you'll general question not script-specific)
you should know contains dynamically created links such one:
window.top.location = "<%= facebook::site_url.to_s %>/logout";
that means putting in .js file in assets/javascript folder isn't going work, since .js files can't access rails-generated variables.
so how can shift javascript dynamically-generated links rails view unobtrusive javascript file?
take on this project include facebook js sdk gem
Comments
Post a Comment