Use jQuery to open PDF links with Google Docs

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2010-04-06T03:49:15Z Indexed on 2010/04/06 3:53 UTC
Read the original article Hit count: 246

Filed under:
|
|

I already have pdf links set up. I am just looking to prepend Google's syntax in front of my current href using jQuery. i know the following doesn't work, but I feel I am close…?

jQuery(document).ready(function() {
jQuery("a[href$=.pdf]").attr("href", "http://docs.google.com/viewer?url=" + current.href);
});

Can anyway help, please?

© Stack Overflow or respective owner

Related posts about googledocs

Related posts about jQuery