My application uses lots of jquery script files and the TABLE ID is hard coded everywhere. The problem is that these IDs changes when the application is either copied or a new sandbox environment...
You should be able to use _DBID_TABLENAME but I could be wrong about that. I definitely know that gDBID is global variable for the table ID your on. Hope that helps.