<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>script &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Get the Server&#8217;s IP Address with PHP</title>
		<link>/2010/06/20/get-the-servers-ip-address-with-php/</link>
		<comments>/2010/06/20/get-the-servers-ip-address-with-php/#respond</comments>
		<pubDate>Sun, 20 Jun 2010 18:47:12 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">/?p=1633</guid>
		<description><![CDATA[If there&#8217;s a need to get the server&#8217;s IP address with PHP, the answer is simple: Actually that looks pretty much like the getting the user&#8217;s IP address:<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/05/10/phpini-for-two-web-servers/" rel="bookmark" title="php.ini for two web servers">php.ini for two web servers </a></li>
<li><a href="/2010/05/22/php-functions-realpath/" rel="bookmark" title="PHP Functions: realpath()">PHP Functions: realpath() </a></li>
<li><a href="/2011/08/17/php-fetch-get-as-string-with-http_build_query/" rel="bookmark" title="PHP: Fetch $_GET as String with http_build_query()">PHP: Fetch $_GET as String with http_build_query() </a></li>
<li><a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" rel="bookmark" title="It&#8217;s Not True that PHP Arrays are Copied by Value">It&#8217;s Not True that PHP Arrays are Copied by Value </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>If there&#8217;s a need to get the server&#8217;s IP address with PHP, the answer is simple:</p>
<pre lang="php">
<?php echo $_SERVER['SERVER_ADDR'] ?>
</pre>
<p>Actually that looks pretty much like the getting the user&#8217;s IP address:</p>
<pre lang="php">
<?php echo $_SERVER['REMOTE_ADDR'] ?>
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/05/10/phpini-for-two-web-servers/" rel="bookmark" title="php.ini for two web servers">php.ini for two web servers </a></li>
<li><a href="/2010/05/22/php-functions-realpath/" rel="bookmark" title="PHP Functions: realpath()">PHP Functions: realpath() </a></li>
<li><a href="/2011/08/17/php-fetch-get-as-string-with-http_build_query/" rel="bookmark" title="PHP: Fetch $_GET as String with http_build_query()">PHP: Fetch $_GET as String with http_build_query() </a></li>
<li><a href="/2012/08/17/its-not-true-that-php-arrays-are-copied-by-value/" rel="bookmark" title="It&#8217;s Not True that PHP Arrays are Copied by Value">It&#8217;s Not True that PHP Arrays are Copied by Value </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/06/20/get-the-servers-ip-address-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Adsense blocks the page load</title>
		<link>/2009/06/10/google-adsense-blocks-the-page-load/</link>
		<comments>/2009/06/10/google-adsense-blocks-the-page-load/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 05:24:42 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">/?p=593</guid>
		<description><![CDATA[The Google Adsense code block Everyone dealing with Google Adsense knows how it looks like as JavaScript code. When you register, apply and receive the code chunk, you receive actually an inline chunk of js describing the width and height of the code and the key, uniquely identifying the page ad and an included javascript &#8230; <a href="/2009/06/10/google-adsense-blocks-the-page-load/" class="more-link">Continue reading <span class="screen-reader-text">Google Adsense blocks the page load</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/06/10/google-adsense-iframes-and-ie/" rel="bookmark" title="Google Adsense, iframes and IE">Google Adsense, iframes and IE </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/06/24/zend-framework-inject-javascript-code-in-a-actionview/" rel="bookmark" title="Zend Framework: Inject JavaScript Code in a Action/View">Zend Framework: Inject JavaScript Code in a Action/View </a></li>
<li><a href="/2009/04/14/load-flash-swf-in-hidden-div/" rel="bookmark" title="load flash .swf in hidden div">load flash .swf in hidden div </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>The Google Adsense code block</h2>
<p>Everyone dealing with Google Adsense knows how it looks like as JavaScript code. When you register, apply and receive the code chunk, you receive actually an inline chunk of js describing the width and height of the code and the key, uniquely identifying the page ad and an included javascript file.</p>
<blockquote>
<pre id="line1">&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;&lt;!--
google_ad_client = "pub-9858850710257888";
/* 250x250, google ad 09-5-19 */
google_ad_slot = "0062396170";
google_ad_width = 250;
google_ad_height = 250;
//--&gt;
&lt;/<span class="end-tag">script</span>&gt;
&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"
</span><span class="attribute-name">src</span>=<span class="attribute-value">"http://pagead2.googlesyndication.co/..."</span>&gt;
&lt;/<span class="end-tag">script</span>&gt;</pre>
</blockquote>
<h2>Inline scripts and their behavior</h2>
<p>The problem with the page load is that inline scripts included somewhere in the page, the case with adsense is just like that, blocks every page load until the script is executed. Of course when you&#8217;ve two or three ads somewhere in your page that causes huge delay of page load. Sometimes that may delay the page twice as much as if there were no ads from Google.</p>
<h2>The workaround</h2>
<p>The simple workaround is to place your ads &lt;script&gt; inline, included or both in a separate .html file and to include it as &lt;iframe&gt;. Such a solution gives the page the ability of render before the iframe is executed and the page load event is fired in an early stage.</p>
<blockquote><p>&lt;iframe src=&#8221;/path_to_the_banner.html&#8221;&gt;&lt;/iframe&gt;</p></blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/06/10/google-adsense-iframes-and-ie/" rel="bookmark" title="Google Adsense, iframes and IE">Google Adsense, iframes and IE </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/06/24/zend-framework-inject-javascript-code-in-a-actionview/" rel="bookmark" title="Zend Framework: Inject JavaScript Code in a Action/View">Zend Framework: Inject JavaScript Code in a Action/View </a></li>
<li><a href="/2009/04/14/load-flash-swf-in-hidden-div/" rel="bookmark" title="load flash .swf in hidden div">load flash .swf in hidden div </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/06/10/google-adsense-blocks-the-page-load/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JQuery ajax script call</title>
		<link>/2009/03/19/jquery-ajax-script-call/</link>
		<comments>/2009/03/19/jquery-ajax-script-call/#respond</comments>
		<pubDate>Thu, 19 Mar 2009 05:45:52 +0000</pubDate>
		<dc:creator><![CDATA[stoimen]]></dc:creator>
				<category><![CDATA[featured]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">/?p=401</guid>
		<description><![CDATA[Learn how to include javascript files in your site via AJAX, using JQuery.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/09/29/jquery-stop-an-ajax-call/" rel="bookmark" title="jQuery &#8211; stop an ajax call!">jQuery &#8211; stop an ajax call! </a></li>
<li><a href="/2009/11/03/ajax-datatypes-in-jquery-format-and-access/" rel="bookmark" title="AJAX dataTypes in jQuery. Format and access.">AJAX dataTypes in jQuery. Format and access. </a></li>
<li><a href="/2009/11/02/ajax-in-jquery/" rel="bookmark" title="$.ajax in jQuery">$.ajax in jQuery </a></li>
<li><a href="/2011/04/05/jquery-unbind/" rel="bookmark" title="jQuery.unbind()">jQuery.unbind() </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Many friends are asking me how to they use JQuery AJAX power. However you have two main ways, using:</p>
<blockquote><p><span style="color: #808080;">$(&#8216;#elem&#8217;).load(&#8216;url&#8217;, &#8221;, function() {});</span></p></blockquote>
<p>or</p>
<blockquote><p><span style="color: #808080;">$.ajax({</span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">type : &#8216;GET&#8217;, // or POST</span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">dataType : &#8216;text&#8217;, // or JSON</span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">url : &#8216;url&#8217;, </span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">data : {}, // GET or POST key/value parameters</span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">success : function () {}, // on success callback</span></p>
<p style="padding-left: 30px;"><span style="color: #808080;">error : function () {} // on error callback</span></p>
<p><span style="color: #808080;">});</span></p></blockquote>
<p><em><span style="color: #333333;">Note: be careful to miss the comma after the error callback declaration, cause IE is giving some problems with objects with comma after the last key/value pair.</span></em></p>
<p>Both methods are useful, but however the second one is more complicated and gives more functionality. It&#8217;s important to note that if you&#8217;d like to include Html, which will be JavaScript processed after that, there are another two ways. The first one is obvious, you can call the javascript file processing the included Html in your success callback of the first ajax call. After calling the second ajax call, be aware to call it with dataType : &#8216;script&#8217;, which includes de js code and parses it as code. Than you can call whatever function in that .js as you&#8217;d do it as it was already included.</p>
<p>That method is obvious and easy, but however on slow nets it&#8217;s pretty slow and it&#8217;s not useful. Actually you can include your script file as you&#8217;d normally do it, with a script tag.</p>
<p>In it you should register all event listeners in methods you can call later. That&#8217;s the better way.</p>
<p>In the first case you have:</p>
<blockquote><p><span style="color: #333333;">$.ajax({</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">type: &#8216;GET&#8217;,</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">dataType: &#8216;text&#8217;,</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">url: &#8216;the_url&#8217;,</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">data: {},</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">success : function () {</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">$.ajax({</span></p>
<p style="padding-left: 90px;"><span style="color: #333333;">type: &#8216;GET&#8217;,</span></p>
<p style="padding-left: 90px;"><span style="color: #333333;">dataType: &#8216;script&#8217;,</span></p>
<p style="padding-left: 90px;"><span style="color: #333333;">url : &#8216;script.js&#8217;,</span></p>
<p style="padding-left: 90px;"><span style="color: #333333;">success : function() {</span></p>
<p style="padding-left: 120px;"><span style="color: #333333;">// now do what you want</span></p>
<p style="padding-left: 90px;"><span style="color: #333333;">}</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">})</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">},</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">error : function() {</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">});</span></p></blockquote>
<p>In the second case you&#8217;d just include your file:</p>
<blockquote><p><span style="color: #333333;">&lt;script src=&#8221;script.js&#8221;&gt;&lt;/script&gt;</span></p>
<p><span style="color: #333333;">&lt;script&gt;</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">$.ajax({</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">type : &#8216;GET&#8217;,</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">dataType : &#8216;text&#8217;,</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">url : &#8216;url&#8217;,</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">success : function() {</span></p>
<p style="padding-left: 90px;"><span style="color: #333333;">init_script(); // method in script.js</span></p>
<p style="padding-left: 60px;"><span style="color: #333333;">}</span></p>
<p style="padding-left: 30px;"><span style="color: #333333;">});</span></p>
<p><span style="color: #333333;">&lt;/script&gt;</span></p></blockquote>
<p>Now everything should work OK, good luck!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/09/29/jquery-stop-an-ajax-call/" rel="bookmark" title="jQuery &#8211; stop an ajax call!">jQuery &#8211; stop an ajax call! </a></li>
<li><a href="/2009/11/03/ajax-datatypes-in-jquery-format-and-access/" rel="bookmark" title="AJAX dataTypes in jQuery. Format and access.">AJAX dataTypes in jQuery. Format and access. </a></li>
<li><a href="/2009/11/02/ajax-in-jquery/" rel="bookmark" title="$.ajax in jQuery">$.ajax in jQuery </a></li>
<li><a href="/2011/04/05/jquery-unbind/" rel="bookmark" title="jQuery.unbind()">jQuery.unbind() </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/03/19/jquery-ajax-script-call/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
