How to open a page then run a script only if page opened from other page
<p>How do I run a script on a page only if the page was opened from another page?  </p>

<p>I have this page element:</p>

<pre><code>    &lt;div id="Devotion_alert"&gt;&lt;/div&gt;
</code></pre>

<p>I add a span with onclick to that div.</p>

<pre><code>    var show_devotion_alert = '&lt;span style="cursor:pointer;" onclick="open_livemass();"&gt;&lt;br/&gt;'+devotion_name+' '+time_info+'&lt;br/&gt;('+devotion_channel.name+')&lt;/span&gt;';
    $('#Devotion_alert').html(show_devotion_alert);
</code></pre>

<p>When the user clicks on the element I want to run a script:</p>

<pre><code>function open_livemass() {
    window.location.href = 'livemass_RECORDED.php';
    // want to select elements on the new page and load element content
}
</code></pre>

<p>When the new page loads I want to select page elements and load element content.  I only want to do that if the new page was opened with a mouseclick from the previous page.</p>
