Fandom Developers Wiki
Advertisement
Forums: Index > Help desk > Show one time only

Hello :) I was just wondering if there is a way to make a template appear only the first time a user visits a page? Thanks, {{SUBST:TheWizardz/Sig}} 23:39, July 19, 2013 (UTC)

Well, I'm just learning JavaScript so I'd probably not know, but I'm guessing you could use console.log("message") and some other code that pops up a box, I forgot what you call it, it's similar to prompt ("message") although that gives a field to write in. Original Authority (talk) 09:14, July 20, 2013 (UTC)
^Well I'm thinking that you could use an alert, you may have to put this in a button, see if somebody more code wise can answer Original Authority (talk) 09:48, July 20, 2013 (UTC)
The Wizardz, the answer is "yes but." :) You can set a cookie on a user's computer the first time they visit the page and check if there's such a cookie when they come back. But, if the user's browser settings block cookies or delete them once the session is over, which is something many people do for privacy, the template will be shown if they close their browser and visit the page later. I'm not sure if that's OK with you. TK-999 (talk) 19:44, July 20, 2013 (UTC)
That would be totally fine ... except for the part where i have no idea how to do that xD  User:TheWizardz786™ (talk) 21:13, July 20, 2013 (UTC)
Advertisement