Bookmarklet javascript working in Chrome but no Firefox or Safari
I want to use this bookmarklet for flickr, the code I have is this
javascript:prompt('Copy the BBcode below','<div class="img-link"><a href="'+location.href+'">'+document.evaluate('//h1[@class="photo-title"]',document,null,XPathResult.STRING_TYPE,null).stringValue+'</a>')
So in Chrome, when I am at a page at Flickr (e.g this http://www.flickr.com/photos/zapeipaa/4876022306/in/photostream/ ), I click the bookmarklet and get the prompt with the code
<div class="img-link"><a href="http://www.flickr.com/photos/zapeipaa/4876022306/in/photostream/">Peace Memorial Park</a>
However in both Firefox and Safari the photo-title (in this case "P开发者_JAVA百科eace Memorial Park") is left out completely.
Is there a way to work around and get it to work in Safari at least?
精彩评论