Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82359

Using __dt_wrapper to determine if an object is a DataTable object...fragile?

$
0
0

I'm using this code to determine whether a given variable is referencing a DataTable object or not:

if(undefined != myObjectVariable.$ && myObjectVariable.$.__dt_wrapper) {
    alert('A DataTable Object');
} else {
    alert('Not a DataTable Object');
}

Since __dt_wrapper is an undocumented internal, I'm wondering how robust this is. I'm also concerned that there might be a set of variables where myObjectVariable.$ is defined, but myObjectVariable.$.__dt_wrapper is not or is false. (I don't really understand what the $ is about.) Is there a better way to do this?


Viewing all articles
Browse latest Browse all 82359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>