Jump to content

Http_referer Not Working In Ie


johnnyg24
 Share

Recommended Posts

I'm trying to hide certain elements on a page IF a user just came from a specific page. I am trying to use ServerVariable("HTTP_REFERER") to store the previous page's URL.

<input id="referingPage" type="hidden" value="<%=Request.ServerVariables ("HTTP_REFERER")%>" />

I then use some RegExp and Jquery to determine if it the previous page meets the criteria.

$(document).ready(function() {var str = $('#referingPage').val()	var lookFor = /sales/gi	sales = lookFor.test(str)	if(sales){		$('#sidenav').hide()			}})

It works well in FF,Chrome and Safari but not IE.Can anyone tell me why?

Link to comment
Share on other sites

If IE doesn't send the referer then there's nothing you can do about that. There are some situations where browsers do not send a referer, or else it is up to the vendor's choice or options set by the user. You may have the referer disabled in IE. Some firewalls or security software will also strip the referer headers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...