Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by Wilson Edwards
at 2024-09-15 13:14:27
Point:500 Replies:2 POST_ID:829277USER_ID:12108
Topic:
javascript
I have one link from Google user image link, which is no any image extension.
How to covert it to DataUrl on href attribue on <a> tag ?
Please comment
Expert: Norton Alex replied at 2024-09-15 19:06:15
Reference link:
https://stackoverflow.com/questions/41030058/how-to-get-the-image-extension-from-a-remote-image-url-that-doesnt-contain-imagAccepted Solution
Expert: Norton Alex replied at 2024-09-15 19:03:48
500 points Excellent
u can try this code
- <img id='google' style='display:block;width:50px;height:50px' src />
- <script>
- fetch("https://lh3.googleusercontent.com/a/ACg8ocIWTkBo9rTI5-JwaOylu-CzmxdF0-LnbybsyIVQSpVyRU9rYw=s96-c")
- .then(response => response.blob())
- .then(blob => {
- console.log('blob.tye',blob.type);
- let reader = new FileReader();
- reader.onload = () => {
- document.getElementById('google').src=reader.result;
- console.log(reader.result)
- };
- reader.readAsDataURL(blob)
- })
- </script>