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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -