我可以根据文件名生成链接吗?
你能帮我解答这个问题吗?假设我在某个文件夹中有一个 html 文档。然后我在同一文件夹中上传一个文件,比如说 pdf。假设我将文件命名为“grab_document.pdf”。是否有一个jquery命令可以使-tag在文件夹中搜索“grab”,识别该文件,然后抓取该文件的名称并使用它?就像(我完全一无所知):
这将帮助我上传文件而不接触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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
$("a[href|='grab']") - 它选择 href 属性值等于 'grab' 或以 'grab' 开头后跟连字符的所有锚标记。
$("a[href^='grab']") - href 属性值以 'grab' 开头的所有锚标记。
希望对您有帮助!
You can use
$("a[href|='grab']") - It selects all anchor tags with a href attribute value equal to 'grab', or starting with 'grab' followed by a hyphen.
$("a[href^='grab']") - All anchor tags with a href attribute value starting with 'grab'.
Hope it helps you!