haku Posted December 22, 2009 Share Posted December 22, 2009 I've got this part of my function: var target = $(this).children(".inner_wrapper").attr("id"); var defaultColor = $("#" + target + " .color_picker").css("background-color"); var hexColor = defaultColor.replace("#", ""); if(defaultColor.match(/rgb/)) { defaultColor = jqueryColorpicker.rgb2hex(defaultColor); } setTimeout("jqueryColorpicker.refreshColor(hexColor, \"#\" + target + \" .color_picker\")", 100); The whole thing worked until I added the definition of hexColor, and the timeout function. So other than those two lines, the code is correct (this is all part of a much larger jquery function). I'm getting the error that 'hexColor isn't defined' in this line: setTimeout("jqueryColorpicker.refreshColor(hexColor, \"#\" + target + \" .color_picker\")", 100); I can't wrap my head around it. hexColor looks to be defined to me, as I defined it right above. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/185974-hexcolor-is-not-defined/ Share on other sites More sharing options...
haku Posted December 22, 2009 Author Share Posted December 22, 2009 I have no idea why this wasn't working, but I discovered that the problem I had for which I wrote this code to fix, lay in a different problem, and this code was unnecessary. So this code ended up being a moot point. Quote Link to comment https://forums.phpfreaks.com/topic/185974-hexcolor-is-not-defined/#findComment-982170 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.