blob: eaa42829593a9dac8f3be11c68b721fb4d275546 [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">
4<html xmlns = "http://www.w3.org/1999/xhtml">
5
6<head>
7 <title>NDN Interest Matches Name</title>
8
Jeff Thompson38422f42012-11-15 00:20:39 -08009 <script type="text/javascript" src="../Helper.js"></script>
Jeff Thompson86aea882012-09-29 17:32:48 -070010
11 <script type="text/javascript">
12
13 function check(){
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070014 var interest = new Interest( new Name(document.getElementById('interest').value));
Jeff Thompson86aea882012-09-29 17:32:48 -070015 interest.scope = 1;
16
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070017 var nameToCheck = new Name(document.getElementById('nameToCheck').value);
Jeff Thompson86aea882012-09-29 17:32:48 -070018
19 var output = (interest.matches_name(nameToCheck) ? "matches" : "doesn't match");
20 document.getElementById('result').innerHTML = output;
21 }
22
23 </script>
24
25</head>
26<body >
27 <form>
28
29 Please enter the name of an interest:<br />
Jeff Thompsonbd829262012-11-30 22:28:37 -080030 <input id="interest" type="text" name="INTEREST" value="//domain.com/ndn/ucla.edu" /> <br/>
Jeff Thompson86aea882012-09-29 17:32:48 -070031
32 Please enter a name to check if the interest matches the name:<br />
Jeff Thompsonbd829262012-11-30 22:28:37 -080033 <input id="nameToCheck" type="text" name="NAME_TO_CHECK" value="/ndn/./ucla.edu/extra" /> <br/>
Jeff Thompson86aea882012-09-29 17:32:48 -070034
35 </form>
36 <button onclick="check()">Check</button>
37
38 <p id="result"></p>
39
40</body>
41</html>