Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 66 lines (65 sloc) 1.711 kB
96ed31f documentation
Nick Kallen authored
1 <html>
2 <head>
3 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
4 <script type="text/javascript" src="jquery.db.js"></script>
5 <script type="text/javascript">
6 $(function() {
7 console.debug(
8 $('.users')
9 .where('.id:eq(1)')
10 .select('.name')
11 );
12 console.debug(
13 $('.users')
14 .where('.name:contains(a)')
15 .and('.name:contains(c)')
16 .select('*')
17 );
18 console.debug(
19 $('.users')
20 .join('.photos')
21 .where('.photos.user_id:eq(.users.id)')
22 .and('.users.id:eq(1)')
23 .select('.photos.url')
24 );
25 });
26 </script>
27 </head>
28 <body>
29 <table class="users">
30 <tbody>
31 <tr>
32 <td class="id">1</td>
33 <td class="name">amy</td>
34 </tr>
35 <tr>
36 <td class="id">2</td>
37 <td class="name">bob</td>
38 </tr>
39 <tr>
40 <td class="id">3</td>
41 <td class="name">carl</td>
42 </tr>
43 </tbody>
44 </table>
45 <table class="photos">
46 <tbody>
47 <tr>
48 <td class="id">1</td>
49 <td class="user_id">1</td>
50 <td class="url">http://www.example.com/foo.png</td>
51 </tr>
52 <tr>
53 <td class="id">2</td>
54 <td class="user_id">2</td>
55 <td class="url">http://www.example.com/bar.png</td>
56 </tr>
57 <tr>
58 <td class="id">3</td>
59 <td class="user_id">3</td>
60 <td class="url">http://www.example.com/baz.png</td>
61 </tr>
62 </tbody>
63 </table>
64 </body>
65 </html>
Something went wrong with that request. Please try again.