Skip to content
Browse files

Adds JS-Current-URL.md

  • Loading branch information...
1 parent 4d6d23c commit ed72f804087d7fde2b47a24b8b0eaa72432b1802 @rishipuri rishipuri committed
Showing with 11 additions and 0 deletions.
  1. +11 −0 JS-Current-URL.md
View
11 JS-Current-URL.md
@@ -0,0 +1,11 @@
+# Get Current URL in Javascript
+
+To get the **current URL**:
+
+ var url = window.location.href;
+
+To get the **current path**:
+
+ var path = window.location.path;
+
+More information about the location object and its properties can be found [here](https://developer.mozilla.org/en-US/docs/Web/API/Window/location).

0 comments on commit ed72f80

Please sign in to comment.
Something went wrong with that request. Please try again.