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
PHP call shell command Did you complain today ? Self made whole person computer program Comparison of data extraction tools :Kettle,Datax,Sqoop,StreamSetsKeras Output the results of each layer of the model Feature Engineering After the outbreak Which programming has a bright future Children programming children's learning route java properties Profile tool class Android Development — Display food information according to customer budget