<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Best practice for adding JavaScript code to WordPress plugins</title> <atom:link href="http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin/feed" rel="self" type="application/rss+xml" /><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin</link> <description>Coding, WordPress, SEO, Games and Rants</description> <lastBuildDate>Sun, 21 Mar 2010 18:36:24 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: 3 proper ways to customize your WordPress blog &#124; WebTechWise</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-17668</link> <dc:creator>3 proper ways to customize your WordPress blog &#124; WebTechWise</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-17668</guid> <description>[...] Too many plugins installed will eventually slow down your blog because many of them process and load javascript and css files in all pages, even the ones they are not used in. (too many is (roughly) &gt; 12, depends on each plugin performance and whether it&#8217;s built the right way). [...]</description> <content:encoded><![CDATA[<p>[...] Too many plugins installed will eventually slow down your blog because many of them process and load javascript and css files in all pages, even the ones they are not used in. (too many is (roughly) &gt; 12, depends on each plugin performance and whether it&#8217;s built the right way). [...]</p> ]]></content:encoded> </item> <item><title>By: WordPress 优化宝典 &#171; 1900</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-17548</link> <dc:creator>WordPress 优化宝典 &#171; 1900</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-17548</guid> <description>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</description> <content:encoded><![CDATA[<p>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</p> ]]></content:encoded> </item> <item><title>By: Artem Russakovskii</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-17542</link> <dc:creator>Artem Russakovskii</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-17542</guid> <description>Vladimir, today I posted about doing conditional script and style loading on regular blog pages, rather than the admin ones, as there is no obvious mechanism like the admin_print_scripts- method to do so on post pages right now.Please see How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts: http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/.</description> <content:encoded><![CDATA[<p>Vladimir, today I posted about doing conditional script and style loading on regular blog pages, rather than the admin ones, as there is no obvious mechanism like the admin_print_scripts- method to do so on post pages right now.</p><p>Please see How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts: <a
href="http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/" rel="nofollow">http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/</a>.</p> ]]></content:encoded> </item> <item><title>By: Brent Shepherd</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-17142</link> <dc:creator>Brent Shepherd</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-17142</guid> <description>Hi Valdimir,Thanks for pointing out the wp_localize_script funciton. I&#039;d previously been looking for how to localize scripts.Should strings to be translated still be enclosed in the __() function?What I mean is, should your example read:
&#039;mode&#039; =&gt; __(&quot;auto&quot;)In the script-loader.php core file, I noticed this is how it is done.Thanks again.Brent</description> <content:encoded><![CDATA[<p>Hi Valdimir,</p><p>Thanks for pointing out the wp_localize_script funciton. I'd previously been looking for how to localize scripts.</p><p>Should strings to be translated still be enclosed in the __() function?</p><p>What I mean is, should your example read:<br
/> 'mode' =&gt; __("auto")</p><p>In the script-loader.php core file, I noticed this is how it is done.</p><p>Thanks again.</p><p>Brent</p> ]]></content:encoded> </item> <item><title>By: Admiyn</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-15247</link> <dc:creator>Admiyn</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-15247</guid> <description>Great tips, and great book
this type of tips helps a lot of new wordpress developers</description> <content:encoded><![CDATA[<p>Great tips, and great book<br
/> this type of tips helps a lot of new wordpress developers</p> ]]></content:encoded> </item> <item><title>By: WordPress优化宝典(ZZ) @ yin的个人空间</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-13730</link> <dc:creator>WordPress优化宝典(ZZ) @ yin的个人空间</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-13730</guid> <description>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</description> <content:encoded><![CDATA[<p>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</p> ]]></content:encoded> </item> <item><title>By: Doug Whitney</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-12993</link> <dc:creator>Doug Whitney</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-12993</guid> <description>Thanks for sharing your your expertise on developing WP plugins. They&#039;ve been a great help, especially the tips on loading javascript properly and improving security with nonce.</description> <content:encoded><![CDATA[<p>Thanks for sharing your your expertise on developing WP plugins. They've been a great help, especially the tips on loading javascript properly and improving security with nonce.</p> ]]></content:encoded> </item> <item><title>By: Smartphone</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-12529</link> <dc:creator>Smartphone</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-12529</guid> <description>Excellent advise. It really help me to add JS script. Before I read your post I spent more the 3 hours trying to add JS script into my plugin.</description> <content:encoded><![CDATA[<p>Excellent advise. It really help me to add JS script. Before I read your post I spent more the 3 hours trying to add JS script into my plugin.</p> ]]></content:encoded> </item> <item><title>By: Peter</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-11168</link> <dc:creator>Peter</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-11168</guid> <description>Quote :&quot;
if (!is_admin())The code above checks if the opened page is not an admin page as we do not want to load scripts there. &quot;You have no idea how much that sentence helped me. It avoided me loading unnecessary Javascript files into the admin pages.Thank you so much and thanks for sharing this.</description> <content:encoded><![CDATA[<p>Quote :</p><p>"<br
/> if (!is_admin())</p><p>The code above checks if the opened page is not an admin page as we do not want to load scripts there. "</p><p>You have no idea how much that sentence helped me. It avoided me loading unnecessary Javascript files into the admin pages.</p><p>Thank you so much and thanks for sharing this.</p> ]]></content:encoded> </item> <item><title>By: WordPress Optimization Bible - From www.prelovac.com &#124; My Web Notes</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-10946</link> <dc:creator>WordPress Optimization Bible - From www.prelovac.com &#124; My Web Notes</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-10946</guid> <description>[...] on the bottom of the page (when possible). I have created a simple plugin which will move the properly registered JavaScript files to the bottom of your pages. The plugin is called Footer [...]</description> <content:encoded><![CDATA[<p>[...] on the bottom of the page (when possible). I have created a simple plugin which will move the properly registered JavaScript files to the bottom of your pages. The plugin is called Footer [...]</p> ]]></content:encoded> </item> <item><title>By: Total Fucked? &#187; Blog Archive &#187; WordPress News: Plugins Reach Milestone, New WordPress Community Project, Help to Search for WordPress Help</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-10879</link> <dc:creator>Total Fucked? &#187; Blog Archive &#187; WordPress News: Plugins Reach Milestone, New WordPress Community Project, Help to Search for WordPress Help</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-10879</guid> <description>[...] also points to AJAX in Plugins from the WordPress Codex, the online manual for WordPress Users, and Best Practice for Adding JavaScript Code to WordPress Plugins by Vladimir Prelovac, worthwhile reads for all Plugin [...]</description> <content:encoded><![CDATA[<p>[...] also points to AJAX in Plugins from the WordPress Codex, the online manual for WordPress Users, and Best Practice for Adding JavaScript Code to WordPress Plugins by Vladimir Prelovac, worthwhile reads for all Plugin [...]</p> ]]></content:encoded> </item> <item><title>By: HOWTO: Make WordPress plugins work with WP Super Cache</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-10738</link> <dc:creator>HOWTO: Make WordPress plugins work with WP Super Cache</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-10738</guid> <description>[...] uses to load Javascript files. That page links to a couple of good pages too including this best practices post. As of this writing, Thaya&#8217;s example don&#8217;t use wp_enqueue_script() but it&#8217;s [...]</description> <content:encoded><![CDATA[<p>[...] uses to load Javascript files. That page links to a couple of good pages too including this best practices post. As of this writing, Thaya&#8217;s example don&#8217;t use wp_enqueue_script() but it&#8217;s [...]</p> ]]></content:encoded> </item> <item><title>By: WordPress 优化宝典 &#124; Wpfans</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-10650</link> <dc:creator>WordPress 优化宝典 &#124; Wpfans</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-10650</guid> <description>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</description> <content:encoded><![CDATA[<p>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</p> ]]></content:encoded> </item> <item><title>By: WordPress 最好的速度优化宝典 - Jeff-Chen.Com</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-10552</link> <dc:creator>WordPress 最好的速度优化宝典 - Jeff-Chen.Com</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-10552</guid> <description>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</description> <content:encoded><![CDATA[<p>[...] 将 CSS 文件放在网页顶部确保他们可以优先载入是一条黄金定律。JavaScript 文件应该放在网页顶部（如果可能的话）。我开发了一个简单的插件，可以将正确注册的 JavaScript 文件移到网页底部。这个插件叫做 Footer javaScript 。 [...]</p> ]]></content:encoded> </item> <item><title>By: Mike</title><link>http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin#comment-10442</link> <dc:creator>Mike</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=820#comment-10442</guid> <description>Awesome - this is just what I needed.</description> <content:encoded><![CDATA[<p>Awesome - this is just what I needed.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Served from: www.prelovac.com @ 2010-03-21 21:28:02 by W3 Total Cache -->