js verification url Is it effective , Support cross domain authentication

background : Sometimes we don't just verify url Is it correct , You also need to verify that you can actually access it

principle : After regular check , Then use ajax To simulate requests , Responsive 200, explain url True and effective , Cross domain application jsonp, The shorter the timeout, the better .
$.ajax({ type: 'get', cache: false, url: url, dataType: "jsonp",
// Cross domain adoption jsonp mode processData: false, timeout:1000, // Time out , millisecond complete: function
(data) { if (data.status==200) { if($('input[name=is_link_origin_url]').val()
== '1'){ $('input[name=is_link_origin_url]').val('0'); }else {
$('input[name=is_link_origin_url]').val('1'); } } else {
$('#check-btn').removeAttr('checked');
$('input[name=is_link_origin_url]').val('0'); alert(" Invalid link "); } } });
 

Technology
©2020 ioDraw All rights reserved
Vue slot slot: Default slot , Named slot , Scope slot algorithm : Longest common subsequence ( Output all longest common subsequences ) Simple student achievement management system 《 How does the program run 》 Chapter 11 Hardware control method FDTD solution—— Material fitting , Light source settings MMKV The principle and implementation of virtual reality ( one )vue-element-admin Step record of adding menu python Simple understanding of decorator Java The realization of snake eating (1 Hour Society ) New photo album app launched by Microsoft : Using cross platform framework React Native to write