| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Use cookie to trigger innerHTML change|
if(isset($_COOKIE[cookiename])) used to check
Using this code, the innerHTML isn't changing. How do I make the innerHTML change? Maybe use setTimeout?
Any ideas? I'm sure this is much easier than I'm making it :P
try this quick test:
<?php print($_COOKIE['pollchoice']); ?>
You should either test the cookie in js, or write #pollarea's content directly in php. There is no use for js here.
Okay, I got it working.
@Achernar, not sure quite what you mean....could you please explain more?
It would be simpler to write directly:
|<div id="pollchoice"><?php |
if (isset($_COOKIE['pollchoice'])) echo "poll results here";
or, if you don't need the empty div:
if (isset($_COOKIE['pollchoice'])) echo "<div id=\"pollchoice\">poll results here</div>";
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved