Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
loading external js files inside modalbox
3 Posts
loading external js files inside modalbox

I'm not familiar with the modalbox library, but I can take a guess at what it's doing. When the browser requests an HTML page it does a bunch of stuff to evaluate JavaScript and stylesheets included in the response. However, modalbox is probably just intercepting that response and stuffing the result into the DOM. Unless it's using an iframe the modal dialog isn't a separate page, it just appears that way due to CSS trickery. If you load the JS files you need on the main page they'll be available in the modal box. The best way to make sure you load the JS everywhere you need it is to put it in your layout.

If the library does use an iframe for the modal box then the browser should parse the JavaScript you send in the page response, in which case someone who knows more about iframes will hopefully speak up.

New

Hi all, Iam using http://okonet.ru/projects/modalbox/ in rails 2.3.2 application .when i use

New

it dispalying new.html.erb in Modalbox but not including javascript files in new.html.erb page.The form contains datepickercontrol.js and country state.js files.

when i run it normally(without modalbox) it working perfectly. please tell me how can i call js file inside modalbox.

3 Posts
Login to add your message