Jump to content

Http_referer Not Working In Ie

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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...