<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged server-optimization</title>
<link>https://www.question2answer.org/qa/tag/server-optimization</link>
<description>Powered by Question2Answer</description>
<item>
<title>Merge qa-page.js and snow-core.js &amp;&amp; move inline scripts to MERGED.js</title>
<link>https://www.question2answer.org/qa/59168/merge-qa-page-js-and-snow-core-js-%26%26-move-inline-scripts-merged</link>
<description>

&lt;p&gt;Dear friends,&lt;/p&gt;

&lt;p&gt;I guess its very important from server perspective to combine js files into ONE.js file and move header inline scripts to this ONE.js.&lt;/p&gt;

&lt;p&gt;Currently, I point CDN path for&amp;nbsp;&lt;span style=&quot;color:rgb(34, 34, 34); font-family:consolas,lucida console,courier new,monospace; font-size:12px&quot;&gt;qa-content/jquery-1.11.3.min.js file. So, I dont need to deal with this anymore. However, I have only two js files in home-page:&amp;nbsp;&lt;/span&gt;qa-page.js and snow-core.js (just ignore other pages). Can I just copy paste all codes from qa-page.js into snow-core.js (I will use only snowflat theme). And where to remove call for&amp;nbsp;qa-page.js?&lt;/p&gt;

&lt;p&gt;More importantly, I have two inline scripts in head and one inline script in body. Two scripts in head are: (&amp;lt;script&amp;gt;var eventnotifyAjaxURL = &quot;./eventnotify&quot;&amp;lt;/script&amp;gt;) and&amp;nbsp;(&amp;lt;script&amp;gt;var qa_root = '.\/'; var qa_request = 'hot';&amp;lt;/script&amp;gt;)&amp;nbsp;&lt;/p&gt;

&lt;p&gt;This eventnotify comes from On-Site Notification plugin. Code is like this:&lt;/p&gt;

&lt;blockquote&gt;

&lt;p&gt;if(qa_opt('q2apro_onsitenotifications_enabled') &amp;amp;&amp;amp; qa_is_logged_in()) {&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;output('&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;/p&gt;

&lt;p&gt;var eventnotifyAjaxURL = &quot;'.qa_path('eventnotify').'&quot;;&lt;/p&gt;

&lt;p&gt;&amp;lt;/script&amp;gt;');&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;One inline script in body is:&amp;nbsp;&lt;/p&gt;

&lt;blockquote&gt;

&lt;p&gt;&amp;lt;script&amp;gt;var b=document.getElementsByTagName('body')[0];b.className=b.className.replace('qa-body-js-off', 'qa-body-js-on');&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;My question is how to move all these inline scripts both in head and body into snow-core.js ? Is it possible? Will the site work properly? Please guide how to do it.&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/59168/merge-qa-page-js-and-snow-core-js-%26%26-move-inline-scripts-merged</guid>
<pubDate>Mon, 21 Aug 2017 15:48:43 +0000</pubDate>
</item>
</channel>
</rss>