jQuery गेटस्क्रिप्ट () विधि
उदाहरण
AJAX अनुरोध का उपयोग करके जावास्क्रिप्ट प्राप्त करें और चलाएं:
$("button").click(function(){
$.getScript("demo_ajax_script.js");
});
परिभाषा और उपयोग
AJAX HTTP GET अनुरोध का उपयोग करके जावास्क्रिप्ट प्राप्त करने और निष्पादित करने के लिए getScript() विधि का उपयोग किया जाता है।
वाक्य - विन्यास
$(selector).getScript(url,success(response,status))
Parameter | Description |
---|---|
url | Required. Specifies the url to send the request to |
success(response,status) | Optional. Specifies the function to run if the request succeeds Additional parameters:
|