Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 1 | <?xml version = "1.0" encoding="utf-8" ?>
|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
| 3 | "DTD/xhtml1-strict.dtd">
|
Jeff Burke | 92dd8e4 | 2012-12-08 11:40:31 -0800 | [diff] [blame] | 4 | <!--
|
| 5 | See COPYING for copyright and distribution information.
|
| 6 | -->
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 7 | <html xmlns = "http://www.w3.org/1999/xhtml">
|
| 8 |
|
| 9 | <head>
|
| 10 | <title>NDN Interest Matches Name</title>
|
| 11 |
|
Alexander Afanasyev | 2a2c9d2 | 2013-03-13 16:21:32 -0700 | [diff] [blame] | 12 | <script type="text/javascript" src="../build/ndn-js.js"></script>
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 13 |
|
| 14 | <script type="text/javascript">
|
| 15 |
|
| 16 | function check(){
|
Jeff Thompson | f3bd359 | 2012-09-29 23:25:30 -0700 | [diff] [blame] | 17 | var interest = new Interest( new Name(document.getElementById('interest').value));
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 18 | interest.scope = 1;
|
| 19 |
|
Jeff Thompson | f3bd359 | 2012-09-29 23:25:30 -0700 | [diff] [blame] | 20 | var nameToCheck = new Name(document.getElementById('nameToCheck').value);
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 21 |
|
| 22 | var output = (interest.matches_name(nameToCheck) ? "matches" : "doesn't match");
|
| 23 | document.getElementById('result').innerHTML = output;
|
| 24 | }
|
| 25 |
|
| 26 | </script>
|
| 27 |
|
| 28 | </head>
|
| 29 | <body >
|
| 30 | <form>
|
| 31 |
|
| 32 | Please enter the name of an interest:<br />
|
Jeff Thompson | bd82926 | 2012-11-30 22:28:37 -0800 | [diff] [blame] | 33 | <input id="interest" type="text" name="INTEREST" value="//domain.com/ndn/ucla.edu" /> <br/>
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 34 |
|
| 35 | Please enter a name to check if the interest matches the name:<br />
|
Jeff Thompson | bd82926 | 2012-11-30 22:28:37 -0800 | [diff] [blame] | 36 | <input id="nameToCheck" type="text" name="NAME_TO_CHECK" value="/ndn/./ucla.edu/extra" /> <br/>
|
Jeff Thompson | 86aea88 | 2012-09-29 17:32:48 -0700 | [diff] [blame] | 37 |
|
| 38 | </form>
|
| 39 | <button onclick="check()">Check</button>
|
| 40 |
|
| 41 | <p id="result"></p>
|
| 42 |
|
| 43 | </body>
|
| 44 | </html>
|