I am writing a JavaScript function that when the user clicks a link from one page, it goes to this page. When the page loads, it should open up a popup box. The problem is I don't know how to tell it in the function to open up onload if the user is coming from a certain link. Otherwise the page should act normal without a popup onload.
window.onload = function() {
var opened = window.open('', 'height = 500, width = 500');
opened.document.write('Open');
}