jQuery UI Endless Loop when referencing a slider that doesn't exist -


if page hangs: var foo = $("#mysliderthatdoesntexist").slider("value");

so may wonder why reference slider doesn't exist? it's called function that's run on page load , when changes on page (server side generates slider on page load).

i wouldn't have thought cause whole page freeze , consume ram on pc.

a bug perhaps? latest stable jquery & jquery ui

you shouldn't have guess workaround be:

var $mysliderthatdoesntexist = $("#mysliderthatdoesntexist"); var foo = ($mysliderthatdoesntexist.length >= 1) ? $mysliderthatdoesntexist.slider("value") : 0; 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -