Andru1989
Andru1989

Reputation: 180

Function with a variable ExtJS

At this time I want just to pass a value with a variable and show it in a modal window, this variable contains a link

<script type="text/javascript">
function mostrar_supports(link){
var link;
var win = new Ext.Window({
    title:  'Soporte Coprenal',
    width:  1000,
    height: 600,
    modal:  true,
    html:   "<iframe src="link" style='width:100%;height:100%;border:none;'></iframe>"
});

win.show();
return false;};
</script>

And the button is like that

             <%= link_to('#', 
                :onclick => "return mostrar_supports('#{request.host_with_port}/supports');") do %>
                <i class="wrenchicon-"></i>&nbsp;Soporte
            <% end %>

So I just want to show in the modal window the content of the url I pass, but I clicked it and doesn't happen anything, it's works just when I write manually the link, what could I do to fix it

html: '<iframe src="../supports" style="width:100%;height:100%;border:none;"></iframe>'

Thanks for your help

Upvotes: 0

Views: 53

Answers (1)

mangr3n
mangr3n

Reputation: 309

try this instead :

html:   "<iframe src='" + link + "' style='width:100%;height:100%;border:none;'></iframe>"

});

Upvotes: 1

Related Questions