mateusz / silverstripe-frontend

15 stars 6 forks source link

Throwing an uncaught type error if lib.js missing, rather than the supplied message #11

Closed adrexia closed 11 years ago

adrexia commented 11 years ago

i.e. throws: Uncaught TypeError: Cannot read property 'addSearchParams' of undefined in this situation:

if (typeof $.path.addSearchParams==='undefined') { throw "ss.pagination error: please include framework/admin/javascript/lib.js"; }

Might need to check whether typeof $.path ==='undefined' before checking a sub property?

mateusz commented 11 years ago

Here you go https://github.com/mateusz/silverstripe-frontend/blob/master/javascript/jquery.ss.pagination.js#L118

adrexia commented 11 years ago

Thanks!