<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[עזרה - .'תרגום' קטע קטן בJQuery לj.s]]></title><description><![CDATA[<p dir="rtl">אשמח אם מישהו כאן יכול לתרגם לי את הקוד דלהלן מJQuery ל j.s רגיל</p>
<pre><code>// Download button (PNG)
$("#download-image").on('click', function() {
	$(this).attr('href', $('#pdf-canvas').get(0).toDataURL());
	
	// Specfify download option with name
	$(this).attr('download', 'page.png');
});

// Download button (JPEG with quality 80%)
$("#download-image").on('click', function() {
	$(this).attr('href', $('#pdf-canvas').get(0).toDataURL("image/jpeg", 0.8));
	
	// Specfify download option with name
	$(this).attr('download', 'page.jpg');
});
</code></pre>
]]></description><link>https://tchumim.com/topic/11664/עזרה-תרגום-קטע-קטן-בjquery-לj-s</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Nov 2026 10:12:33 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/11664.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jul 2021 11:06:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Mon, 16 Aug 2021 14:11:04 GMT]]></title><description><![CDATA[<p dir="rtl"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%92%D7%99" aria-label="Profile: חגי">@<bdi>חגי</bdi></a> אמר ב<a href="/post/127041">עזרה - .'תרגום' קטע קטן בJQuery לj.s</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chv" aria-label="Profile: chv">@<bdi>chv</bdi></a> אמר ב<a href="/post/126594">עזרה - .'תרגום' קטע קטן בJQuery לj.s</a>:</p>
<blockquote>
<p dir="auto">document.getElementById('pdf-canvas').get(0)</p>
</blockquote>
<p dir="rtl">כמדומני שזה אמור להחזיר רק אלמנט אחד (ולא סט), אז .get אמור להכשל.</p>
</blockquote>
<p dir="rtl">צודק..<br />
צ"ל לקחת ישירות את ה-dataurl מהאלמנט</p>
<pre><code>// Download button (PNG)
document.getElementById('download-image').addEventListener('click', (e) =&gt; {
  this.setAttribute('href', document.getElementById('pdf-canvas').toDataURL())
  // Specfify download option with name
  this.setAttribute('download', 'page.png')
})

// Download button (JPEG with quality 80%)
document.getElementById('download-image').addEventListener('click', (e) =&gt; {
  this.setAttribute('href', document.getElementById('pdf-canvas').toDataURL('image/jpeg', 0.8))
  // Specfify download option with name
  this.setAttribute('download', 'page.jpg')
})
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dovid" aria-label="Profile: dovid">@<bdi>dovid</bdi></a> תכל'ס - צודק..</p>
]]></description><link>https://tchumim.com/post/127403</link><guid isPermaLink="true">https://tchumim.com/post/127403</guid><dc:creator><![CDATA[chv]]></dc:creator><pubDate>Mon, 16 Aug 2021 14:11:04 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Sun, 08 Aug 2021 17:32:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chv" aria-label="Profile: chv">@<bdi>chv</bdi></a> התשובות שלך הם בסגנון אל תשאל פה סתם, תעבוד...<br />
אולי מאכזב אותך שאין פה אתגר גדול אבל אם אתה עונה תענה. תשובה לא מושקעת גרועה מכלום (כי אז מישהו אחר ישקיע).<br />
כפי ש@חגי  העיר גם הקוד האחרון שגוי.</p>
]]></description><link>https://tchumim.com/post/127053</link><guid isPermaLink="true">https://tchumim.com/post/127053</guid><dc:creator><![CDATA[dovid]]></dc:creator><pubDate>Sun, 08 Aug 2021 17:32:07 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Sun, 08 Aug 2021 14:20:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chv" aria-label="Profile: chv">@<bdi>chv</bdi></a> אמר ב<a href="/post/126594">עזרה - .'תרגום' קטע קטן בJQuery לj.s</a>:</p>
<blockquote>
<p dir="auto">document.getElementById('pdf-canvas').get(0)</p>
</blockquote>
<p dir="rtl">כמדומני שזה אמור להחזיר רק אלמנט אחד (ולא סט), אז .get אמור להכשל.</p>
]]></description><link>https://tchumim.com/post/127041</link><guid isPermaLink="true">https://tchumim.com/post/127041</guid><dc:creator><![CDATA[חגי]]></dc:creator><pubDate>Sun, 08 Aug 2021 14:20:27 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Thu, 29 Jul 2021 11:27:24 GMT]]></title><description><![CDATA[<p dir="rtl">@ב-ל צודק, יש לומר <code>setAttribute</code></p>
<pre><code>// Download button (PNG)
document.getElementById('download-image').addEventListener('click', (e) =&gt; {
  this.setAttribute('href', document.getElementById('pdf-canvas').get(0).toDataURL())

  // Specfify download option with name
  this.setAttribute('download', 'page.png')
})

// Download button (JPEG with quality 80%)
document.getElementById('download-image').addEventListener('click', (e) =&gt; {
  this.setAttribute('href', document.getElementById('pdf-canvas').get(0).toDataURL('image/jpeg', 0.8))

  // Specfify download option with name
  this.setAttribute('download', 'page.jpg')
})
</code></pre>
]]></description><link>https://tchumim.com/post/126594</link><guid isPermaLink="true">https://tchumim.com/post/126594</guid><dc:creator><![CDATA[chv]]></dc:creator><pubDate>Thu, 29 Jul 2021 11:27:24 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Thu, 29 Jul 2021 11:20:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chv" aria-label="Profile: chv">@<bdi>chv</bdi></a><br />
ואגב this.attr זה גם  JQuery</p>
]]></description><link>https://tchumim.com/post/126592</link><guid isPermaLink="true">https://tchumim.com/post/126592</guid><dc:creator><![CDATA[ב.ל]]></dc:creator><pubDate>Thu, 29 Jul 2021 11:20:46 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Thu, 29 Jul 2021 11:19:24 GMT]]></title><description><![CDATA[<p dir="rtl">@ב-ל לא חסרים כלים שעושים convert מ-JQUERY לקוד JS</p>
]]></description><link>https://tchumim.com/post/126591</link><guid isPermaLink="true">https://tchumim.com/post/126591</guid><dc:creator><![CDATA[chv]]></dc:creator><pubDate>Thu, 29 Jul 2021 11:19:24 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Thu, 29 Jul 2021 11:18:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chv" aria-label="Profile: chv">@<bdi>chv</bdi></a> אמר ב<a href="/post/126587">עזרה - .'תרגום' קטע קטן בJQuery לj.s</a>:</p>
<p dir="rtl">תודה</p>
<blockquote>
<p dir="rtl">פעם הבאה תעשה גוגל</p>
</blockquote>
<p dir="rtl">איך? לבדוק מילה, מילה?</p>
]]></description><link>https://tchumim.com/post/126590</link><guid isPermaLink="true">https://tchumim.com/post/126590</guid><dc:creator><![CDATA[ב.ל]]></dc:creator><pubDate>Thu, 29 Jul 2021 11:18:07 GMT</pubDate></item><item><title><![CDATA[Reply to עזרה - .'תרגום' קטע קטן בJQuery לj.s on Thu, 29 Jul 2021 11:16:01 GMT]]></title><description><![CDATA[<p dir="rtl">@ב-ל פעם הבאה תעשה גוגל</p>
<pre><code>// Download button (PNG)
document.getElementById('download-image').addEventListener('click', (e) =&gt; {
  this.attr('href', document.getElementById('pdf-canvas').get(0).toDataURL())

  // Specfify download option with name
  this.attr('download', 'page.png')
})

// Download button (JPEG with quality 80%)
document.getElementById('download-image').addEventListener('click', (e) =&gt; {
  this.attr('href', document.getElementById('pdf-canvas').get(0).toDataURL('image/jpeg', 0.8))

  // Specfify download option with name
  this.attr('download', 'page.jpg')
})

</code></pre>
]]></description><link>https://tchumim.com/post/126587</link><guid isPermaLink="true">https://tchumim.com/post/126587</guid><dc:creator><![CDATA[chv]]></dc:creator><pubDate>Thu, 29 Jul 2021 11:16:01 GMT</pubDate></item></channel></rss>