The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Passing basic information using JS only!

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #35544

    This is not a question, more of a code show-off.
    This is really basic, it get’s the information like this (in the URL) will be here, and it can include things like ! and ?

    Here is the code for saving the information behind the “?”, removing the “?” and fixing basic errors.
    Javascript code:

    var URLinfo = decodeURI(;

    decodeURI is for fixing “%20” for spaces and stuff like that. Also, the substring is to remove “?” in the start of the URL.

    Now (of course) you put this information anywhere like this:


    For instance, I use this for my sharing pop up. The way I did that was to make the link like this: + location.href
    and then I get the information on the sharing window and insert it in the sharing textbox. Really great :)


    Yeah that’s pretty cool. Have you seen this before?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.