You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can also create a link dynamically in JavaScript and simulate a click by `link.click()`, then download starts automatically.
76
+
Aynı zamanda JavaScript'te bir link yaratabilir ve tıklama eylemini `link.click()` ile simüle edebiliriz, ardından indirme otomatik olarak başlayacaktır.
77
77
78
-
Here's the similar code that causes user to download the dynamicallly created Blob, without any HTML:
78
+
Aşağıda hiç HTML içermeden kullanıcının yaratılmış bir Blob'u otomatik olarak indirmesini sağlayacak bir kod yer alıyor:
79
79
80
80
```js run
81
81
let link =document.createElement('a');
82
-
link.download='hello.txt';
82
+
link.download='merhaba.txt';
83
83
84
-
let blob =newBlob(['Hello, world!'], {type:'text/plain'});
84
+
let blob =newBlob(['Merhaba Dünya!'], {type:'text/plain'});
85
85
86
86
link.href=URL.createObjectURL(blob);
87
87
@@ -90,19 +90,19 @@ link.click();
90
90
URL.revokeObjectURL(link.href);
91
91
```
92
92
93
-
`URL.createObjectURL` takes a blob and creates an unique URL for it, in the form `blob:<origin>/<uuid>`.
93
+
`URL.createObjectURL`, bir blob'u alır ve ondan `blob:<kaynak>:<uuid>` formatında benzersiz bir URL oluşturur.
The browser for each url generated by `URL.createObjectURL`stores an the url -> blob mapping internally. So such urls are short, but allow to access the blob.
101
+
`URL.createObjectURL`ile oluşturulmuş her bir URL'in tarayıcısı, url -> blob iç adreslemesini barındırır. Bu nedenle URL'ler kısadır fakat blob'a erişmeye izin verir.
102
102
103
-
A generated url (and hence the link with it) is only valid within the current document, while it's open. And it allows to reference the blob in `<img>`, `<a>`, basically any other object that expects an url.
103
+
Oluşturulmuş URL (ve dolayısıyla onunla bağlantılı link) yalnızca içinde bulunduğu mevcut belge için, açık olduğu sürece geçerlidir ve `<img>`, `<a>` gibi, bir URL bekleyen herhangi bir objedeki blob'u göstermeyi sağlar.
104
104
105
-
There's a side-effect though. While there's an mapping for a blob, the blob itself resides in the memory. The browser can't free it.
105
+
Ancak burada bir yan etki vardır. Bir blob adreslendiğinde blob'un kendisi hafızada bulunur. Tarayıcı onu hafızadan silemez.
106
106
107
107
The mapping is automatically cleared on document unload, so blobs are freed then. But if an app is long-living, then that doesn't happen soon.
0 commit comments