Javascript pop-up won’t reopen or refocus when I click on the link.
This one is a bit of a tricky one, especially if you are not primarily a Javascript developer and not intimately familiar with its inner workings. The issue arrises when you create a Javascript pop-up window, close it, and then try to open it again. Or when you create a pop-up focus on something else, and the click on the link trying to refocus on the same window and nothing happens. At least for me, this was a pretty big "What the hell?" kind of moment because I have lots of pop-up windows with Javascript and never have had a problem before. What changed?
My First Open Source Project Released… googlePop.
This week I released my first bit of open source code. It's an open source Hello World project to print Hello Worlds across the... world. No, I'm just kidding. It is a bit of code I wrote at work to pop up a window with a Google Map. It accepts latitude, longitude, and a string as parameters. The string is displayed on a blue banner on the bottom of the map. It's fairly simple code but I figured it could be useful to others. It is released under the MIT License meaning feel free to use, abuse, and mangle my code in any fashion you see fit for whatever project, commercial or otherwise. Feel free to ask me any questions you may have about it, but I think it is pretty straightforward. The code is written in HTML, CSS, PHP, and Javascript using the Google Maps V3 Javascript API. You can find it here on GitHub:
If you do use it, it would be cool to know where it ends up. Leave it a comment or send an email to gpop at bricode period com. Happy coding.
PHP sizeof() or count() not working on my string to return the length!
Quick PHP tip here. I spent a half hour trying to figure this out and I figure someone else must be seeing something similar. sizeof() and count() only work (as you would expect them to work, anyway) on arrays. If you use it on a string, it will return 1 because it views a string as an array of one string in that context. The function you are actually searching for is strlen() like in C. Hope that saves someone some time.
