JavaScript templates – Minus Mor plugin

First we need to install plugin: cd rails_app_directory ./script/plugin install http://svn.danwebb.net/external/rails/plugins/minus_mor Now we can use in views new kind of files .ejs templates. They are just like .rhtml, but instead of embedding Ruby code in HTML, You use JavaScript as an native language, and insert Rails/Ruby code with well known <%= and <% tags. This …

JavaScript – no automatic conversion to number

I was surprised when I wrote code to extract values from cookie and using it to set map center. Well it looks like in JS there is no automatic conversion from string to number. Code looks like: if ( res = getCookie(“rnsloc”).match(“(.*)-(.*)-(.*)”) ) { map.setCenter( new GLatLng(res[1], res[2]), res[3] ) } else map.setCenter( new GLatLng(52.2419, …

IE JavaScript & DOM debugging

Well, my last post about IE have resulted in some feedback, so I write some afterword First, there are some Developers Toolbar for IE like IE Developer Toolbar from MS, or DebugBar (http://www.debugbar.com/). Currently I’m using MS one and it is good enough for me. Debuggers for JavaScript are available at least two from MS. …

Synchronization between objects in JavaScript

I’m working on some Google Maps mashup and I’ve ran on weired problem. I want to display map, then let user do search for some place, redraw map, and with AJAX call check if on freshly redraw map is something to mark. Of course I need to pass bounds (map.getBounds()) to this call. So I …

GMarkerManager and setImage – why it fails?

I wrote simple howto about changing icons in markers when markers is already placed on map. And I was asked question about setImage and GMarkerManger. Problem is that when changing image with setImage old image will be displayed when user zooms map in or out – when GMarkerManager is used to place markers on map. …