我可以根据文件名生成链接吗?

发布于 2025-01-17 05:31:56 字数 286 浏览 4 评论 0原文

你能帮我解答这个问题吗?假设我在某个文件夹中有一个 html 文档。然后我在同一文件夹中上传一个文件,比如说 pdf。假设我将文件命名为“grab_document.pdf”。是否有一个jquery命令可以使-tag在文件夹中搜索“grab”,识别该文件,然后抓取该文件的名称并使用它?就像(我完全一无所知):

document

这将帮助我上传文件而不接触html......我希望。

谢谢你! 安德烈

Can you help me with this question? Lets say I have a html document in a certain folder. Then I upload a file in the same folder, lets say a pdf. And lets say I name the file "grab_document.pdf". Is there a jquery command to make the -tag search for "grab" in the folder, recognize the file and then grab the name of the file and use it? Like (I am absolutely clueless):

<a href="$(grab file in folder beginning with the letters "grab")">document

That would help me to upload files without touching the html... I hope.

Thank you!
Andre

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

段念尘 2025-01-24 05:31:56

您可以使用

  1. $("a[href|='grab']") - 它选择 href 属性值等于 'grab' 或以 'grab' 开头后跟连字符的所有锚标记。

  2. $("a[href^='grab']") - href 属性值以 'grab' 开头的所有锚标记。

希望对您有帮助!

You can use

  1. $("a[href|='grab']") - It selects all anchor tags with a href attribute value equal to 'grab', or starting with 'grab' followed by a hyphen.

  2. $("a[href^='grab']") - All anchor tags with a href attribute value starting with 'grab'.

Hope it helps you!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文