Example of using Regular Expressions for syntax checking in JavaScript?
Submitted by: Administratorvar re = new RegExp(" ^(&[A-Za-z_0-9]{1,}=[A-Za-z_0-9]{1,})*$" )
<br>var text = myWidget.value
<br>var OK = re.test(text)
<br>if( ! OK ) {
<br>alert(" The extra parameters need some work.
Should be something like: " &a=1&c=4" " ) <br>} <br>
Submitted by: Administrator
Should be something like: " &a=1&c=4" " ) <br>} <br>
Submitted by: Administrator
Read Online JavaScript Job Interview Questions And Answers
Top JavaScript Questions
☺ | How is JavaScript different from Java? |
☺ | What are a fixed-width table and its advantages in JavaScript? |
☺ | How to set a HTML document's background color? |
☺ | What is a prompt box? |
☺ | How to find radio button selection when a form is submitted? |
Top Top World Wide Web Categories
☺ | Cascading Style Sheet CSS Interview Questions. |
☺ | HTML5 Interview Questions. |
☺ | Basic Internet Interview Questions. |
☺ | Domain Name System (DNS) Interview Questions. |
☺ | JavaScript Interview Questions. |