if ($('input[name="iIsRedirect"]').prop('checked') && p2['sRedirectURL'] != '') {
var sRedirectURL = $('input[name="sRedirectURL"]' ).val(),
reg = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&|-)+)/g; / /Regular expression judges http:// https:// for legal
objExp = new RegExp(reg);
if (objExp.test(sRedirectURL) != true) {
layer.alert('The jump address is incorrect!');
return;
}
}
reg = /^(http:\/\/|^https:\/\/|^\/\/)((\w|=|\?|\.|\/|&|-)+)/g ; // Regular expression judges that http:// https:// //The beginning is legal
This method judges whether a url obtained is a valid address with a regular match