If two url are like:
http://localhost:1113/Project/TestCourse.aspx?id=
http://localhost:1112/Project/TestCourse.aspx
How to check whether 'id' is present or not using javascript?
If two url are like:
http://localhost:1113/Project/TestCourse.aspx?id=
http://localhost:1112/Project/TestCourse.aspx
How to check whether 'id' is present or not using javascript?
I would tweak @KooiInc's answer to location.href.match(/(\?|&)id($|&|=)/)
. It catches parameters without values (for example http://localhost:1112/Project/TestCourse.aspx?id) and also ensures you only have id not just a param starting with id (e.g idparam).