| <?xml version = "1.0" encoding="utf-8" ?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "DTD/xhtml1-strict.dtd"> | |
| <!-- | |
| See COPYING for copyright and distribution information. | |
| --> | |
| <html xmlns = "http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <title>NDN Interest Matches Name</title> | |
| <script type="text/javascript" src="../Helper.js"></script> | |
| <script type="text/javascript"> | |
| function check(){ | |
| var interest = new Interest( new Name(document.getElementById('interest').value)); | |
| interest.scope = 1; | |
| var nameToCheck = new Name(document.getElementById('nameToCheck').value); | |
| var output = (interest.matches_name(nameToCheck) ? "matches" : "doesn't match"); | |
| document.getElementById('result').innerHTML = output; | |
| } | |
| </script> | |
| </head> | |
| <body > | |
| <form> | |
| Please enter the name of an interest:<br /> | |
| <input id="interest" type="text" name="INTEREST" value="//domain.com/ndn/ucla.edu" /> <br/> | |
| Please enter a name to check if the interest matches the name:<br /> | |
| <input id="nameToCheck" type="text" name="NAME_TO_CHECK" value="/ndn/./ucla.edu/extra" /> <br/> | |
| </form> | |
| <button onclick="check()">Check</button> | |
| <p id="result"></p> | |
| </body> | |
| </html> |