

Web Tools #548 - URL.canParse(), Web Frameworks, Git/CLI Tools, Vue Tools
source link: https://mailchi.mp/webtoolsweekly/web-tools-548
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

URL.canParse(), Web Frameworks, Git/CLI Tools, Vue Tools
|
Issue #548 • January 18, 2024
Advertisement
|
Build with the Power of Code — Without Writing Any Take control of HTML, CSS, and JavaScript in a visual canvas. Webflow generates clean, semantic code that’s ready to publish or hand to developers. |
In case you didn't know, there's a URL interface that exposes a number of different properties and methods for dealing with URLs in the browser. One relatively new method that now has almost cross-browser support in all modern browsers is the URL.canParse() method.
Notice the middle two lines are both checking a relative URL. But only the second one returns true because the first one doesn't provide a base. The last line checks an object (in this case a reference to an anchor element on the page). This assumes there is at least one anchor element present, otherwise it would return false.
You can try out my examples in this CodePen demo, which has al link on the page to ensure the fourth line works as expected. |
Recommend
-
16
净利增长548%,这只黑马爆发!君临财富微信公众号:君临财富。全球投资大趋势。建材...
-
12
You are here: Home / Radio Show / #548 – The Last Line of Defense#548 – The Last Line of Defense Podcast:
-
12
Frameworks, Testing Tools, Uncats (misc. tools) Issue #443 • January 13, 2022 Advertisement
-
7
Frameworks, Build Tools, Uncats Issue #446 • February 3, 2022 Advertisement ...
-
9
New MDN, Frameworks, Build, React Issue #450 • March 3, 2022 Advertisement ...
-
12
Front-end Frameworks, SVG, React Native
-
11
Mergify, Frameworks, React Tools, Uncats ...
-
11
I hope you guys enjoyed the contest and we hope to host another one soon! The next one will be more balanced :PWith that said, here are the tutorials:
-
7
Today's Wordle Answer #548 - December 19, 2022 Solution And Hints ...
-
10
Raw JS, Frameworks, Git/CLI Tools, Jamstack, CMS's ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK