Hi, I'm making a 404 page, and I want it to display the current URL, but I don't want it to be server side. I don't know much about any variables are anything, so it would be nice if a nice person could give me all of the needed code and how to use it! :$
Thanks in advance!

Recommended Answers

All 3 Replies

Why certainly!!

As gained from here:

      document.write("The current URL is : "+location.href)
      // -->

You will need to modify it a bit to match the input you want for your 404 but that snippet will get you the URL of the current page the user is on.

Hope that helps :)

Thank you SO MUCH!!!!

Thank you SO MUCH!
I have an other question about Javascript, but i'll post a new thread. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.