title: Django/JavaScript: passing hidden variables to a page with window.location.href?
body: <p>Apologies if this question is a bit convoluted.</p>
  
  <p>I want a Django page to display a banner message <em>sometimes</em>. Sometimes the user will arrive via <code>window.location.href</code>, and then I would like the banner to display, with a message determined by the action the user just performed. </p>
  
  <p>Details: </p>
  
  <ul>
  <li>I have a site-wide javascript listener that listens for scanner input (which presents as keyboard input).</li>
  <li>When it triggers, using jQuery I return or check out the item, dependent on its state. I do this via an Ajax POST request.</li>
  <li>Then I immediately take the user to the item's page on my site. I do this by setting <code>window.location.href</code> to the item's page, inside the response handler of the POST request. The item shows as available or checked out, but I want to show the user another message too... </li>
  <li>...I want to show a banner saying 'Item checked out' or 'Item returned'. </li>
  </ul>
  
  <p>The last item is where I'm having problems: how do I 'tell' the item page what message to show, and when to show a message at all? People will also arrive at item pages not via the scanner.</p>
  
  <ul>
  <li>I could set GET parameters (<code>?t=checked_out</code> or <code>?t=returned</code>) but that feels messy. </li>
  <li>I could use cookies but that feels even messier. </li>
  <li>If I POST to the item page (which also feels wrong) with a <code>t=checked_out</code> parameter, wouldn't it be good Django practice to then redirect somewhere else, rather than display the page? </li>
  </ul>
  
  <p>Perhaps I'm just too hung up on the last point.</p>
  
  <p>Anyway, the basic question is: How best can I pass hidden variables to a page via <code>window.location.href</code>?</p>
  
  <p>Thanks for your help. I have the feeling there's something fundamental that I've yet to learn here :)</p>