سؤال

How can i get the URL of the previous page in JavaScript?
I mean the value of this function:

history.back()

or this one :

history.go(-1)
هل كانت مفيدة؟

المحلول

For privacy reasons, you will never be able to do that.

نصائح أخرى

In JavaScript, you use the document.referrer property, which will give you the URL of the page where the user came from.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top