0

I am trying to figure out how to get the parts of a URL I am going to be receiving from a third-party website. The URL I am expecting is something like: index.html?lob=company&ZipCode=22407

All of my pages are coded in .html rather than PHP due to my client's needs/desires, so my question is how can I get the "ZipCode" value.

In PHP this would be super simple, however I cannot do that.

Mark
  • 3,609
  • 1
  • 22
  • 33
Dylan Cross
  • 5,918
  • 22
  • 77
  • 118

1 Answers1

3

Use Javascript instead.

var value_of_zipcode = "index.html?lob=company&ZipCode=22407".match("ZipCode=([0-9]{5})")[1];

now the value_of_zipcode is 22407

Fathan
  • 112
  • 1
  • 4