Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 53 lines (48 sloc) 1.521 kB
77933fe first commit
caphun authored
1 <!doctype html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title>jQuery: Inline Edit Plugin Demo</title>
6 <link rel="stylesheet" href="http://yelotofu.com/labs/jquery/master.css" media="screen">
7 <style type="text/css">
2faef4f used correct hover class.
caphun authored
8 .ui-state-hover { background-color: #ffC }
77933fe first commit
caphun authored
9 .inlineEdit-placeholder { font-style: italic; color: #555; }
10 </style>
0d1cfa5 improved delegation demo and upgraded to jquery 1.5.1
caphun authored
11 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
8ee9d09 fixed save script and moved back to camelCase
caphun authored
12 <script type="text/javascript" src="../jquery.inlineedit.js"></script>
77933fe first commit
caphun authored
13 <script type="text/javascript">
14
15 $(function(){
16 // setup common ajax setting
17 $.ajaxSetup({
18 url: 'save.php',
19 type: 'POST',
20 async: false,
21 timeout: 500
22 });
23
24 // call inlineEdit
25 $('.editable').inlineEdit({
26 value: $.ajax({ data: { 'action': 'get' } }).responseText,
27 save: function(event, data) {
28 var html = $.ajax({
29 data: { 'action': 'save', 'value': data.value }
30 }).responseText;
31
3cec86d changed save callback's this to the original dom element
caphun authored
32 alert("id: " + this.id );
33
77933fe first commit
caphun authored
34 return html === 'OK' ? true : false;
35 }
36 });
37 });
38
39 </script>
40 </head>
41 <body>
42 <div id="page">
43 <div id="header">
44 <h1>jQuery: Inline Edit Plugin with save script</h1>
45 </div>
46 <div id="content">
47 <table>
3cec86d changed save callback's this to the original dom element
caphun authored
48 <tr><td><span id="editable_01" class="editable"></span></td></tr>
77933fe first commit
caphun authored
49 </table>
50 </div>
51 </div>
52 </body>
53 </html>
Something went wrong with that request. Please try again.