Welcome Guest, Not a member yet? Register   Sign In
loading a view through javascript
#1

[eluser]breaddes[/eluser]
i've create template modules that i want to load into a website actively using javascript. is it possible to call a view that way? i am working with prototype and scriptaculous.
#2

[eluser]Nick Husher[/eluser]
You need to create a controller that will configure and serve those view files. The javascript can't directly manipulate data on the server, so you have to play a game of telephone with it a little bit.
#3

[eluser]breaddes[/eluser]
thanks for your response. can i call a controller function by javascript?
#4

[eluser]nmweb[/eluser]
Sure, no problem.
#5

[eluser]breaddes[/eluser]
the thig is that i don't want to load a bunch of html modules by default. i want to load them just in time, when they're needed.


Code:
window.onload = function(){
    $('login').onclick = function(){
            
       //here is where want to load a certain view actually    
       fadein('dialog', 1);
       fadein('overlay', 0.8);
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB