Is there any way to redirect to a new page and write some content with jquery on that page?
<p>I am making a function which searches the database for flight information. I want user to be redirected on "ticket.php" if the response is true. I want to update the content of the page "ticket.php" using jquery. But jquery doesn't work. Am I doing something wrong here ? Here's part of javascript. It's an external javascript. It's included in both "search.php" and "ticket.php" page. This function gets invoked by clicking on search button in "search.php" page.  </p>

<pre><code>if(data){
    setTimeout("location.href = 'ticket.php';",3000); // Redirect to new page

//Change content of "ticket.php" using jquery.
    $("#source").text(x);
    $("#destination").text(y);
    $("#date").text(z);
    $("#no_person").text(person);
    $("#trip_type").text(type);
}

else
    $("#alert").text("Oops! No Flight matches your criteria ! ");
</code></pre>
