javascript - If user came from previous page on site then this, else do this -
what viable way accomplish following:
a website has 2 pages; parent page , inside page. if user came inside page directly typing in address or following link page other parent page, show "foo". if user came inside page parent page, show "bar".
i need done in js if possible. if not, php secondary choice.
please try this
this code in second page
jquery(window).load(function() { if (sessionstorage.getitem('dontload') == null) { //show bar } else{ //show foo } });
this code in parent page
jquery(window).load(function() { sessionstorage.setitem('dontload','true') });
Comments
Post a Comment