Home >Web Front-end >JS Tutorial >Cross-domain calling files based on jquery_jquery

Cross-domain calling files based on jquery_jquery

WBOY
WBOYOriginal
2016-05-16 18:15:571000browse

The official documentation specifically states that this function is only applicable to versions after 1.2, not previous versions.

Copy code The code is as follows:

function GetCrossDomainContent() {
$.getScript( "http://two.xthost.info/im0417/cnblogs.txt", function() { if (typeof (msg) != "undefined") { $("#TestCrossDomain").val(msg[0]) ; }
});

Official explanation

jQuery.getScript(url, [callback])

Parameter 1: url, String type. The address of the JS file to be loaded.

Parameter 2: callback (optional), Function type. Callback function after successful loading.
Copy code The code is as follows:




Detailed reference:http://www.jb51.net/shouce/jquery/jquery_api/Ajax/$.getScript. html
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn