views:

358

answers:

9

I refer to Phil Haack's "Undoable" article found here: http://haacked.com/archive/2010/01/01/jquery-undoable-plugin.aspx

I've copied the exact mark-up for the table from the tables demo page, included JQuery 1.3.2 min, and copied the exact script block used on the demo page but when it gets to this bit:

$('a.delete').undoable({
 inlineStyling: false,
 showingStatus: function(undoable) {

I keep getting "Object doesn't support this property or method". Is there anything obvious that I might be missing to cause that? I'm just using IE8 on the dev machine but that shouldn't be a problem (I hope).

+1  A: 

"Object doesn't support this property or method" may imply that your link to the jQuery library is invalid. Can you verify that jquery is actually being loaded maybe with a simple alert like this:

 $(document).ready(function(){alert("loaded")});
Vincent Ramdhanie
That works fine, suggesting the library is loaded properly.
FerretallicA
A: 

Along the lines of Vincent's response - make sure you're adding jquery.undoable.js file to your page

Marek Karbarz
Yep, it's done immediately after linking jquery132min
FerretallicA
I've even resorted to linking directly to the file on his site used in the example to make sure it's getting the same file, same contents etc...
FerretallicA
+1  A: 

try this version (and look through the code for similar un-apostrophed JSONs).

$('a.delete').undoable({
 'inlineStyling': false,
 'showingStatus': function(undoable) {
Itay Moav
A: 

Make sure you include your own .js script AFTER you include the JQuery library script

sean717
A: 

Hy, my question is the

$('a.delete')

selector is working?
You could print out,if it's null,than the problem is with the selector

Sad0w1nL1ght
+1  A: 

Are you perhaps loading the javascript files from the file system? This could fail in Internet Explorer due to security restrictions. From what you are saying it could be that you are loading jquery fine, but not the plug-in. Try to load both files from the site, as another commenter suggested.

There is no problem with the plug-in. I've tested it both in Firefox and IE 7 and it works. So the problem is of the javascript libraries failing to load for some reason.

kgiannakakis
IE does have issues with executing scripts from local storage. (for security reasons)
sholsinger
A: 

Perhaps the '$' symbol isn't bound to the jQuery object. Does replacing '$' with 'jQuery' work?

Ryan
A: 

try

$('a.delete').ready(function() { this.undoable({
 inlineStyling: false,
 showingStatus: function(undoable) {
}}

also, the sample code actually looks like this, did you try just this code? (He said it does not have a backend in the sample...

<script type="text/javascript" src="lib/jquery-1.3.2.min.js"></script> 
<script type="text/javascript" src="src/jquery.undoable.js"></script> 

<script type="text/javascript"> 
    /* 
        Enables undoable operations
    */
    $(function() {
        $('a.delete').undoable();
    });
</script> 
Hogan
A: 

The actual code defining undoable is not in the example on the page, and not part of jQuery. I think you forgot to include the library itself.

You can get that here: http://github.com/Haacked/jquery.undoable/blob/master/src/jquery.undoable.js

Triptych
No, I definitely included it. It is on the example page, I copied the include jquery.undoable line from the page source to make sure what I was using matched the actual running example.
FerretallicA