Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
how to check and validate the url of a previous visit to our page using jquery

I have a static page in the form of a puzzle, I want to use the argument "if else" so that my page can be viewed if the url of my page is clicked from the site I want. For example, simple.

if my result page is visited through this site.

https://example.com

so https://example.com/result can be seen.

however, if my page is visited through this site

https://example-2.com

or not through example.com site, or visit the example.com/result link directly without going through the https://example.com

so https://example.com/result Not showing anything.

Can I implement a system like this on my static page using only arguments if else jquery?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can use

document.referrer

The Document.referrer property returns the URI of the page that linked to this page.(MDN)

you can do something like this

if (document.referrer != ""){
    if (new URLPattern(document.referrer).hostname === new URLPattern(window.location.origin).hostname){
        //show result 
    }
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!