Loading DT on third party site, after manipulating DOM?

Loading DT on third party site, after manipulating DOM?

edvinedvin Posts: 2Questions: 1Answers: 0

I'm trying to launch DataTables on a website that is not my own, using TamperMonkey for Chrome (similar to GreaseMonkey for Firefox).
The website in question is Discogs, and the TABLE has the ID "#versions" and appears on pages like this one:
http://www.discogs.com/David-Bowie-David-Bowie/master/50884

It's the long list of releases I want to use with DataTables to enable sorting & searching.

  1. The first issue is to modify the TABLE as it's lacking a THEAD. That's easy.
  2. The second issue is to load dataTable on to this manipulated table. This is where I'm stuck... Is it even possible? Will dataTables even know I have modified the TABLE? I get the "Cannot read property 'mData' of undefined"-error no matter what. Is dataTables reading the original DOM and can't find my new fancy THEAD?
    The DataTables Debugger says "DataTables is not available on this page." - but inspecting the DOM reveals that there indeed is a "dataTable"-class on the TABLE, which I didn't put there, but that's it...

Answers

  • tangerinetangerine Posts: 3,224Questions: 30Answers: 378

    Do you have Discogs' permission to do this?

  • edvinedvin Posts: 2Questions: 1Answers: 0

    I can't see what that have to do with anything. All the JS and CSS is loaded and applied on the locally cached copy.
    I run TamperMonkey for other uses on Discogs, so that's not the issue. Please read my questions again.

This discussion has been closed.