Hide / Remove Info Window / Bubble for Embedded Google Maps

A quick note added in February 2011. Google has now removed the iwloc part of the url in most cases. To remove the pin, you can now add &iwloc=near to the end of the iframe src attribute. So….

<iframe width=”300″ height=”300″ frameborder=”0″ scrolling=”no” marginheight=”0″ marginwidth=”0″ src=”http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=manchester&aq=&sll=53.41654,-2.236788&sspn=0.033864,0.090294&ie=UTF8&hq=&hnear=Manchester&t=h&z=12&ll=53.480712,-2.234376&output=embed“></iframe>

…would become…

<iframe width=”300″ height=”300″ frameborder=”0″ scrolling=”no” marginheight=”0″ marginwidth=”0″ src=”http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=manchester&aq=&sll=53.41654,-2.236788&sspn=0.033864,0.090294&ie=UTF8&hq=&hnear=Manchester&t=h&z=12&ll=53.480712,-2.234376&output=embed&iwloc=near“></iframe>

Thanks to John below for pointing this out

Old information:

Google have tweaked things again. Here is the latest way (March 2009) to embed a map including a location pin without the annoying info window or info bubble showing above it and ruining the maps centre location.

This is particularly important if you are using a small sized map less than around 400px square.

Continue reading

Facebook FBJS basics

Just a post about the most basic parts of Facebook built in canvas Javascript library which they has called FBJS (Facebook Javascript).

To protect themselves from the more evil developers Facebook have introduced Javascript in a limited and controlled way. You can still do most things you can in Javascript but mainly using getter and setter function.

Accessing elements and walking the DOM

You can still use many of the standard methods for accessing and navigating the DOM.

document.getElementById(id) // as you would expect
document.getRootElement() // gets the highest dom tree element accessible to canvas page developers
document.creatElement('DIV') // would create a new div element
document.getElementsByTagName('DIV') // returns all div elements

I would suggest setting up a base function to save yourself some repetition

function byId(id)
{
    return document.getElementById(id)||false;
}

Facebook use getters and setters for many Javascript functions including

byId('id').getNextSibling(); // same as .nextSibling;
byId('id').getPreviousSibling(); // same as .previousSibling;
byId('id').getFirstChild(); // same as .firstChild;
byId('id').getLastChild(); // same as .lastChild;
byId('id').getParentNode(); // same as .parentNode;
byId('id').getChildNodes(); // same as .childNodes;

Manipulating Elements

byId('id').appendChild(node); // as .appendChild(node);
byId('id').insertBefore(node,caret); // as .insertBefore(node,caret);
byId('id').removeChild(node); // as .removeChild(node);
byId('id').replaceChild(node);
byId('id').cloneNode(tree); // as .cloneNode(tree);

Manipulating Tags and Attributes

byId('id').setTextValue(text); // innerHTML with text only

byId('id').setValue(value); // as .value=newValue;
byId('id').getValue(); // as .value;

Microsoft Plans Quick Fix for IE

As a webdeveloper I know a lot about Internet Explorer.

The number of security issues it has and the none standards complient way it renders webpages often makes me wish they would say “You know what, lets just stop making browsers, we clearly aren’t up to the task, lets just suggest everyone go and get firefox instead”

But instead they suggest this useless list of tips:

Continue reading