What is the expression I should use in order to check for a valid url in javascript?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Take a look at this complete regular expression for URLs that has been generated automatically based on the RFC 1738.
Depends no how complicated you want the check to be.
Here's an uber-complicated one:
Actually, regular expressions are quiet portable between platforms. Most examples from a google search can be used in Javascript, albeit maybe with a few "flavor" modifications.