简体   繁体   中英

JS Fiddle duplicating a script

I am trying to get an example using dynatable to work in JSFiddle.

I have found an example here http://jsfiddle.net/brandonzylstra/G4m95/ copy pasted all the code to a personal project:

$(document).ready( function() {
    $('#local').dynatable({
      dataset: {
        records: JSON.parse($('#music').text())
      }
    });

    // getting JSON from a remote source fails:
    $('#remote').dynatable({
      dataset: {
        ajax: true,
        ajaxOnLoad: true,
        ajaxUrl: '//www.dynatable.com/dynatable-ajax.json',
        records: []
      }
    });
});

http://jsfiddle.net/vbiter/3g9dxy42/

Nothing happens. The data isn't loaded. I'd hazard that it's the external references, but they're identical to the ones used in the sample.

Any ideas?

You haven't selected jquery in your new fiddle. Do that and it should work fine.

Here's how you select that:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM