English 中文(简体)
任何人都能够帮助我用这一 j子在 as子中验证ur。
原标题:Can anyone help me with this javascript for validating url in aspx?

我的法典

  function Validate_URL(url) {
      var iurl = url.value;
      var v = new RegExp();
      v.compile("/^(((ht|f){1}(tp:[/][/]){1})|((www.){1}))[-a-zA-Z0-9@:%_+.~#?&//=]+$/;");
      if (!v.test(iurl.value)) {
          url.style.backgroundColor =  yellow ;
      }
      return true; 
  }

http://www.abc.com/newpage.html“rel=“nofollow noreferer” http://www.abc.com/newpage.html。 如何?

问题回答

当你重新使用施工器时,你不提开和结束<代码>/。 在此情况下,你不再使用任何动态扼杀手段,因此你可以使用 Java本 literal。

因此,最好做的是:

var v = /pattern/;

<代码>{1}总是多余的,如你只具备一个要素,则属于特性类别。 <代码>:需要从外面性质班级逃走。 www.un.org/Depts/DGACM/index_french.htm 这只是一个可能的子主。 我不知道你在品格上为什么有两倍。 还有其他问题,如允许<代码>@和#。 页: 1 你们最终还拥有一只平线半殖民地。

这方面还有其他许多问题,包括:。 检查是否有有效的URL,和url 验证使用javascript





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签