blob: 48e00cb9a1f7a2e419b2508a165e9bd81bfa2d9b [file] [log] [blame]
Jeff Thompson86aea882012-09-29 17:32:48 -07001<?xml version = "1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3"DTD/xhtml1-strict.dtd">
Jeff Burke92dd8e42012-12-08 11:40:31 -08004<!--
5 See COPYING for copyright and distribution information.
6-->
Jeff Thompson86aea882012-09-29 17:32:48 -07007<html xmlns = "http://www.w3.org/1999/xhtml">
8
9<head>
10 <title>NDN Interest Matches Name</title>
11
Alexander Afanasyev2a2c9d22013-03-13 16:21:32 -070012 <script type="text/javascript" src="../build/ndn-js.js"></script>
Jeff Thompson86aea882012-09-29 17:32:48 -070013
14 <script type="text/javascript">
15
16 function check(){
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070017 var interest = new Interest( new Name(document.getElementById('interest').value));
Jeff Thompson86aea882012-09-29 17:32:48 -070018 interest.scope = 1;
19
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070020 var nameToCheck = new Name(document.getElementById('nameToCheck').value);
Jeff Thompson86aea882012-09-29 17:32:48 -070021
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 Thompsonbd829262012-11-30 22:28:37 -080033 <input id="interest" type="text" name="INTEREST" value="//domain.com/ndn/ucla.edu" /> <br/>
Jeff Thompson86aea882012-09-29 17:32:48 -070034
35 Please enter a name to check if the interest matches the name:<br />
Jeff Thompsonbd829262012-11-30 22:28:37 -080036 <input id="nameToCheck" type="text" name="NAME_TO_CHECK" value="/ndn/./ucla.edu/extra" /> <br/>
Jeff Thompson86aea882012-09-29 17:32:48 -070037
38 </form>
39 <button onclick="check()">Check</button>
40
41 <p id="result"></p>
42
43</body>
44</html>