I want to make a jQuery based custom popup window for my site using javascript.
I prototyped it by storing the HTML to go in the popup inside a javascript string variable and then display that string thus:
$('#pop_div').html(string);
where string
is defined thus:
var string= '<div class="className">' +
'HTML Content'+
'</div>'
I've seen a few websites that do this but think it is incorrect.
It works for static html snippets but not for rails generated html using <%= .. %>
What is the best way of loading HTML code generated by rails into a javascript/jquery script?
thanks