# 將 GoogleDrive 分享連結 to 圖片連結

返回列表

  • 範例輸入格式
https://drive.google.com/file/d/1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4/view?usp=sharing

`2023/04/22發現有新版 是 /view?usp=share_link 結尾`
https://drive.google.com/file/d/1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4/view?usp=share_link
1
2
3
4
  • 範例輸出格式
https://drive.google.com/uc?export=download&id=1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4
1

作品

操作方式

1.點輸入框, 貼上連結

2.點產生圖片 URL 的按鈕

3.點複製按鈕複製結果(連結) => 拿去貼上做使用
1
2
3
4
5

# 圖片使用教學

巴哈文章open in new window

![小米](https://drive.google.com/uc?export=download&id=1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4)
1
<img
  width="50px"
  src="https://drive.google.com/uc?export=download&id=1FgTcxp2FPxXZD9FxlYgMABWGEYPIT3k4"
/>
1
2
3
4

成果圖

成果

# 參考資料

那些被忽略但很好用的 Web API / Clipboardopen in new window

How TO - Copy Text to Clipboardopen in new window

# 我學到什麼

# 複習了

  • HTMLInputElement.select(); //可以選擇文字
  • HTMLInputElement.focus() //可以 focus 在輸入框

# 第一次知道了

文件說這個是已經過時的語法,我覺得好處是不用請求使用者同意(但有資安疑慮),比較現代的寫法是用ClipboardAPI

  • HTMLInputElement.setSelectionRange() //可以從被 focused 的 input 元素選取特定範圍

返回列表

Last Updated: 2023/4/23 下午9:52:15
Contributors: Richard Lin, 林原醇, Richard