मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)75k · #2812

defer-async

यह क्या करती है

यह स्किल जाँचती है कि वेब पेज के HTML में स्क्रिप्ट कैसे लोड होती हैं। यह पेज जल्दी दिखाने चाहने वाले डेवलपर के लिए है।

कब इस्तेमाल करें

  • ✓जब स्क्रिप्ट डाउनलोड होते समय पेज खाली स्क्रीन दिखाता है।
  • ✓जब head में स्क्रिप्ट टैग पहले दृश्य को धीमा करते हैं।
  • ✓जब आप धीमे कनेक्शन पर पेज जल्दी दिखना शुरू करना चाहते हैं।

Skill का लिंक

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/defer-async/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/defer-async/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप मेरे पेज के स्क्रिप्ट टैग जाँच सकते हैं, ताकि वे लोडिंग को धीमा न करें?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट ऐसे स्क्रिप्ट टैग खोजता है जो पेज को रोकते हैं, और जहाँ सुरक्षित हो वहाँ defer या async जोड़ता है। वह उपयुक्त स्क्रिप्ट को module प्रकार में भी बदल सकता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Load scripts with defer, async, or type=module

A plain <script> tag in the document head blocks all HTML parsing until the script downloads, parses, and executes. On a slow network this can add seconds of white-screen time before any content renders. defer and async allow the browser to continue parsing HTML while the script downloads, reducing Time to First Contentful Paint dramatically.

Quick Reference

  • defer downloads in parallel and executes after HTML parsing, in order — use for most scripts
  • async downloads in parallel and executes immediately when ready — use for independent scripts
  • type=module always defers and enables ES module syntax
  • Never place scripts in <head> without defer or async

Check

Find all script tags in this HTML file. Flag any in the <head> without defer or async, and any at the bottom of <body> that could be in <head> with defer.

Fix

Add defer or async to script tags in the document head, or convert to type=module where ES modules are used.

Explain

Explain the difference between defer, async, and type=module script loading, and when to use each.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Load scripts with defer, async, or type=module. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/html/defer-async

अक्सर पूछे जाने वाले सवाल

defer और async में क्या अंतर है?

Defer पेज पढ़े जाने के बाद स्क्रिप्ट को क्रम से चलाता है। Async हर स्क्रिप्ट को आते ही चलाता है, किसी तय क्रम के बिना।

मुझे कौन-सा इस्तेमाल करना चाहिए?

स्किल ज़्यादातर स्क्रिप्ट के लिए defer और स्वतंत्र स्क्रिप्ट के लिए async की सिफ़ारिश करती है।

क्या यह फ़्रेमवर्क साइटों पर लागू होता है?

स्किल कहती है कि सिर्फ़ सोर्स टेम्पलेट नहीं, बल्कि ब्राउज़र को मिलने वाले अंतिम HTML की जाँच करें।

जानकारी

लेखक का मूल विवरण

Use when reviewing templates, rendered HTML, or shared components related to Load scripts with defer, async, or type=module. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

लोकप्रियता

GitHub स्टार
75k
रैंकिंग में स्थान
#2812
लाइसेंस
MIT
अपडेट की गई
31/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills