
Javascript enthusiast | Addicted to soccer and @manUTD
- Tweets97
- Following317
- Followers138
- Likes33

ALT Oftentimes, when you want to use a web font on your website or application, you know in advance which letters you'll need. This often occurs when you're using a web font in a logo or heading. In these cases, you should consider specifying a text= value in your font request URL. This allows Google to return a font file that's optimized for your request. In some cases, this can reduce the size of the font file by up to 90%. To use this feature, simply add text= to your Google Fonts API requests. For example if you're only using Inconsolata for the title of your blog, you can put the title itself as the value of text=. Here is what the request would look like: https://fonts.googleapis.com/css?family=Inconsolata&text=Hello As with all query strings, you should URL-encode the value: https://fonts.googleapis.com/css?family=Inconsolata&text=Hello%20World

ALT Demo: Is cross-origin fetch allowed? From https:/web.stanford.edu/class/cs253/: const res = await fetch('https://axess.stanford.edu') const data = await res.body.text() console.log(data) No! Would be a huge violation of Same Origin Policy. Any site in the world could read your grades if you're logged into Axess in another tab!

ALT Patterns.dev is free book on design patterns and component patterns for building powerful web apps with vanilla JavaScript and React. We publish patterns, tips and tricks for improving how you architect apps for free. Keep in mind, design patterns are descriptive, not prescriptive. They can guide you when facing a problem other developers have encountered many times before, but are not a blunt tool for jamming into every scenario. Patterns.dev aims to be a catalog of patterns (for increasing awareness) rather than a checklist (what you must do).























