Amazon Berkeley Public Library Linky

By k7lim Last update Mar 11, 2007 — Installed 240 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 2 posts, 2 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Michael Huang User

It seems that Amazon has changed the way it's header works. This is what I changed:

For display on line 31:

insertLink: function(isbn, hrefTitle, aLabel, color )
{

var title = origTitle.firstChild.nodeValue;
var div = origTitle.parentNode.parentNode;
var b = origTitle.parentNode;

var newTitle = document.createElement('span');
newTitle.setAttribute('id','btAsinTitle');

var titleText = document.createTextNode(title);
newTitle.appendChild(titleText);

var newTitleB = document.createElement('b');
newTitleB.setAttribute('class','asinTitle');
newTitleB.appendChild(newTitle);

var br = document.createElement('br');

var link = document.createElement('a');
link.setAttribute ( 'title', hrefTitle );
link.setAttribute('href', libraryUrlPattern + isbn);
link.setAttribute('style','color: ' + color);

var label = document.createTextNode( aLabel );

link.appendChild(label);

div.insertBefore(newTitleB, b);
div.insertBefore(br, b);
div.insertBefore(link, b);
div.removeChild(b);
},

On line 188 for selecting the element:

var origTitle = document.getElementById("btAsinTitle");

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel