使用 jQuery 通过 Google 文档打开 PDF 链接
我已经设置了 pdf 链接。我只是想使用 jQuery 在我当前的 href 前面添加 Google 的语法。我知道以下不起作用,但我觉得我很接近......?
jQuery(document).ready(function() { jQuery("a[href$=.pdf]").attr("href", "http://docs.google.com/viewer?url=" + current.href); });
无论如何可以帮忙吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要原始文档中有绝对网址,以下内容就应该有效。
As long as you have absolute urls in the original document the following should work.