Skip to content

Instantly share code, notes, and snippets.

@mjgallag
Last active December 11, 2015 16:28
Show Gist options
  • Select an option

  • Save mjgallag/4627735 to your computer and use it in GitHub Desktop.

Select an option

Save mjgallag/4627735 to your computer and use it in GitHub Desktop.
var HasSession;
function hasSession(onTrue, onFalse) {
var script = document.createElement('script');
script.src = 'https://na1.salesforce.com/apex/HasSession';
script.onload = function() {
document.head.removeChild(script);
if (HasSession)
onTrue();
else
onFalse();
};
HasSession = false;
document.head.appendChild(script);
};
<apex:page contentType="text/javascript">
parent.HasSession = true;
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment