The most reliable way is to put /favicon.ico at the root of your site. But to point to another image you can use code like this, as featured at the Wikipedia favicon page:
<link rel="icon" type="image/x-icon" href="/somepath/image.ico" />
<link rel="SHORTCUT ICON" href="/somepath/image.ico" />
Adjust the path and type value to match the image type.
No jQuery, though I suppose you could write JavaScript to inject these tags into the <head> so browsers would see them, but it seems easier just to add the html <link> tags.