i want to ask you how to make an ajax call to bring out an some size window when click a link.Just tell me the outline instead of detail about how to.Thank you!
I use an unobtrusive approach, with this prototype library: http://livepipe.net/projects/control_modal/ .
1. Put a normal link in your view <a class="someclass" href="some_action">link</a>. 2. Then in the application.js just initialize it:
$$('a.someclass').each(function(link){ new Control.Modal(link,{ [...] }); });
Thank you.I will try it.
An wrote:
I use an unobtrusive approach, with this prototype library: http://livepipe.net/projects/control_modal/ .
1. Put a normal link in your view <a class="someclass" href="some_action">link</a>. 2. Then in the application.js just initialize it:
$$('a.someclass').each(function(link){ new Control.Modal(link,{ [...] }); });
hello: I have downloaded the file "control.modal.2.2.3.js" and put it in "public\javascripts" directory. Then in the application.js initialize it: $$('a.someclass').each(function(link){ new Control.Modal(link,{ opacity: 0.8, position: 'relative', width: 300, height: 50 }); });
I have an action named "more" and its view "more.rhtml".In my product view,there is a link:<a class="someclass" href="more">link</a>. But when i click the link,this link behaviors like a normal link,not Pop-up a window.How do i manage it?
Dont' know if still usefull.
If it behaves like a normal link there is an error in javascript or in loading the javascript file. Use a tool like firebug for firefox to check if everything is ok.