How can I run this JavaScript snippet only once when a user logs in? -


i have simple javascript snippet.

<script> window.onload = function(){     swal("hello!", "welcome portal", "success"); }; </script> 

how can run if page url http://portal/?init i.e. not run when page url http://portal or http://portal/?something_else?

check location.search of page.

<script type="text/javascript"> if(location.search == "?init"){     window.onload = function(){         swal("hello!", "welcome portal", "success");     }; } </script> 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -