Skip to content

Commit 931749b

Browse files
committed
Use window.location rather than window.location.toString()
window.location is simpler, and works fine given the stringifier on the Location interface. This makes the example slightly simpler. I got here from w3ctag/design-reviews#221.
1 parent 505a2fb commit 931749b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ <h2>
135135
&lt;body&gt;
136136
&lt;script&gt;
137137
window.addEventListener('load', () =&gt; {
138-
var parsedUrl = new URL(window.location.toString());
138+
var parsedUrl = new URL(window.location);
139139
console.log('Title shared: ' + parsedUrl.searchParams.get('name'));
140140
console.log('Text shared: ' + parsedUrl.searchParams.get('description'));
141141
console.log('URL shared: ' + parsedUrl.searchParams.get('link'));

0 commit comments

Comments
 (0)