-1

this is my html page content (a part of it)

<body onLoad="javascript:introJs().start();"> <div id="page"> <div id="header"> <a href="javascript:void(0);" onclick="javascript:introJs().start();" class="friends left">Link</a> Headline </div>

I have implemented introjs with my html page as shown above. but i need to automatically execute the function given on html onLoad.. but only on first visit with cookies. I have no idea about cookies. can anyone please change or create a cookie which execute the introjs automatically on first visit.

arulmr
  • 8,620
  • 9
  • 54
  • 69
Aroo
  • 141
  • 1
  • 10
  • 1
    No. This is not a "do it for me" site, rather a Q&A site. You need to try this yourself, then come back if you have a problem. – CodingIntrigue Oct 08 '13 at 07:34

1 Answers1

1

You can use localstorage like,

SCRIPT

window.onload=function(){
   if(!localstorage.getItem('intorjsInit') && localstorage.getItem('intorjsInit')!=1)
   {
      javascript:introJs().start();
   }
   else
   {
      localstorage.setItem('intorjsInit',1);
   }
};

HTML

<body><div id="page">.....
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106