[英]java - edit url parameter of a page and show editing as a hyperlink in same page
重新加載頁面並將其放入超鏈接並在同一頁面中顯示時,我需要Java代碼才能從URL中獲取一部分。
例
重新加載時從頁面網址獲取Google驅動器文件ID:
http // example.com#https // drive.google.com / open?id = fileid
。
並使用新參數將其添加到此超鏈接中:
http // docs.google.com / uc?id =文件ID &export = download
你不能嘗試JavaScript正則表達式
var url = window.location.href;
var parts = url.match(/id=(\w+)/);
console.log(parts[1]);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.