jQuery getScript() 方法

jQuery 教程 · 2019-03-28 13:57:10

实例

使用 AJAX 请求,获取和运行 JavaScript:

$("button").click(function(){ $.getScript("demo_ajax_script.js"); });

定义和用法

getScript() 方法使用 AJAX 的 HTTP GET 请求获取和执行 JavaScript。

语法

$(selector).getScript(url,success(response,status))

参数 描述
url 必需。规定将请求发送到哪个 URL。
success(response,status) 可选。规定当请求成功时运行的函数。
额外的参数:
  • response - 包含来自请求的结果数据
  • status - 包含请求的状态("success"、"notmodified"、"error"、"timeout"、"parsererror")

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Introduction to the Design and Analysis of Algorithms

Introduction to the Design and Analysis of Algorithms

Anany Levitin / Addison Wesley / 2011-10-10 / USD 117.00

Based on a new classification of algorithm design techniques and a clear delineation of analysis methods, Introduction to the Design and Analysis of Algorithms presents the subject in a coherent a......一起来看看 《Introduction to the Design and Analysis of Algorithms》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

html转js在线工具
html转js在线工具

html转js在线工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具