13
डायनामिक रूप से src के साथ स्क्रिप्ट टैग जोड़ें, जिसमें document.write शामिल हो सकता है
मैं गतिशील रूप से एक वेबपेज में एक स्क्रिप्ट टैग को शामिल करना चाहता हूं, हालांकि मेरा इस पर कोई नियंत्रण नहीं है इसलिए src = "source.js" इस तरह दिख सकता है। document.write('<script type="text/javascript">') document.write('alert("hello world")') document.write('</script>') document.write('<p>goodbye world</p>') अब आम तौर पर डाल रहा है <script type="text/javascript" src="source.js"></script> सिर …