本文介绍了如何使用javascript验证网站网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我想使用javascript acn进行网站url验证,然后发送任何代码段或准则
hello,
I want web site url validation using javascript acn u send any snippets or guide lines
推荐答案
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="Error"
ForeColor="#FF3300" SetFocusOnError="True"
ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
ValidationGroup="yourgroup"></asp:RegularExpressionValidator>
最好的问候
M.Mitwalli
Best Regards
M.Mitwalli
var s = window.location.host
if(s.indexOf("www.mywebsite.com") == -1)
{
//the url is not mine so do what need to be done.
}
这篇关于如何使用javascript验证网站网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!