Saturday, September 21, 2019

UE Wonderboom installs, pairs, connects but doesn't show up in Playback devices

This post is about the UE (UltimateEars) Wonderboom bluetooth speaker.

Problem:
- it installs, pairs, connects but doesn't show up in Playback devices

(my) Cause:
- I restored my PC from a previous backup but of course the Bluetooth drivers were no longer working, so they needed to be reinstalled. This was noticeable because when I went to Control Panel > Hardware and Sound > Devices and Printers, it showed my PC under 'Devices' with a yellow triangle symbol with an exclamation mark, indicating something is not ok. Then when I right-clicked and clicked Troubleshoot, it told me that there was a problem with various device drivers (various Bluetooth audio drivers in my case). Simple reason: it's because my Bluetooth Suite wasn't installed.

(my) Solution:
- reinstall the Bluetooth drivers for the PC (in my case Bluetooth Suite) and reboot
- after this, just pair your Wonderboom as usual in Windows Bluetooth Settings


Tuesday, May 7, 2019

onclick in span not working (fixed)

Problem

I had the following HTML and JavaScript code:

<span onclick="close()">x</span>

<script>
function close() {
    doSomething();
}
</script>

My close() function was never being triggered, no matter what. It didn't even help if I made my span display: block and gave it some width and height. I clicked on my span and nothing happened.

Then, after some fiddling around, I finally figured it out. Yes, it's important to debug. I first tried alert("hi") and that worked, so I knew it had something to do with my function.

Solution

Change the function name to myClose(), then it works. This is because the close() function already exists in JavaScript and it will conflict with your close() function. I suspect this has something to do with event bubbling, but I'm not sure.

Conclusion

Don't name your function names too stock or you will risk overlapping an already existing JavaScript method. In my case, the (window).close() function already existed in JavaScript.