$.get
just sends an HTTP request
to your server, but doesn't actually do anything anything with the data (in your case,
the rendered template) it gets back from the
server.
Try something like
this:
$("#load_btn").click(function()
{
$("html").load("/callback");
}
Or
if the template you render doesn't contain any
tags, only body content, you can
do
$("#load_btn").click(function()
{
$("body").load("/callback");
}
Or,
you can exchange "body" for a specific element to only replace a specific part of the
page.
If you want the user to be redirected, do
this:
$("#load_btn").click(function()
{
window.location =
"/callback";
}
No comments:
Post a Comment