Wednesday, February 24, 2010
A number of publishers have asked us if it's acceptable to place multiple publishers' ad code on the same page or site. Often they'll run into this issue when two AdSense publishers manage a site together and both want to display their ads, or if a site owner hosts content and ads from other publishers on the same page as their own.
The answer is that yes, we do allow this.
Wednesday, February 17, 2010
jQuery makes creation and loading DOM elements (in our case images) very easy. If you need to preload an image you can use this jQuery script here:
// Create an image elementFirst jQuery creates a image DOM element and setting the
var image1 = $('<img />').attr('src', 'imageURL.jpg');
srcattribute of the image element would tell the user browser to load that image. Thus preloading the image.
Next you should insert your DOM element into the DOM tree using one of the many jQuery DOM manipulation methods.
var image1 = $('<img />').attr('src', 'imageURL.jpg');But the best way is to use a callback function, so it inserts the preloaded image into the application when it has completed loading. To achieve this simply use
// Insert preloaded image into the DOM tree
// Insert preloaded image after it finishes loading
$('.profile').append( $(this) );
// Your other custom code