<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Against All Odds - Javascript</title>
			<link>http://www.ppshein.net/index.cfm</link>
			<description>A blog for ColdFusion, Android, jQuery, jQueryMobile, Oracle, HL7 and other Web-based programming languages, Web Server like IIS7 and RDMS like Oracle, Microsoft SQL and MySQL.</description>
			<language>en-us</language>
			<pubDate>Wed, 19 Jun 2013 11:52:02 -0700</pubDate>
			<lastBuildDate>Thu, 07 Jun 2012 19:27:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>pyaephyoeshein@gmail.com</managingEditor>
			<webMaster>pyaephyoeshein@gmail.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>pyaephyoeshein@gmail.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>To replace javascript alert with CFMessagebox</title>
				<link>http://www.ppshein.net/index.cfm/2012/6/7/To-replace-javascript-alert-with-CFMessagebox</link>
				<description>
				
				Before my development, I&apos;ve already used native javascript alert for client side validation message. Some people might complaint why I used native javascript alert instead of jQuery dialogbox, it&apos;s because of I don&apos;t want to include so many script tags and CSS tags for jQuery mobile.

Today, I&apos;ve got an idea to replace native javascript alert with cfmessagebox. This function will support to display cfmessagebox instead of javascript alert whenever we have put javascript alert in our coding.
				 [More]
				</description>
				
				
				<category>Coldfusion</category>
				
				<category>Javascript</category>
				
				<pubDate>Thu, 07 Jun 2012 19:27:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2012/6/7/To-replace-javascript-alert-with-CFMessagebox</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Get Javascript value from Coldfusion in same page</title>
				<link>http://www.ppshein.net/index.cfm/2012/2/10/Get-Javascript-value-from-Coldfusion-in-same-page</link>
				<description>
				
				Today, I&apos;ve found funny resolution to get javascript value from Coldfusion in same page without reloading. I&apos;m not sure whether it might be useful or not, but for me it&apos;s kinda useful.

&lt;b&gt;Usage&lt;/b&gt;

&lt;code&gt;
&lt;cfsavecontent variable=&quot;JSvalue&quot;&gt;
	&lt;script&gt;
		var whatisyourname = &quot;ppshein&quot;;
		document.write(whatisyourname);
	&lt;/script&gt;
&lt;/cfsavecontent&gt;

&lt;cfoutput&gt;#JSvalue#&lt;/cfoutput&gt;
&lt;/code&gt;
				
				</description>
				
				
				<category>Coldfusion</category>
				
				<category>Javascript</category>
				
				<pubDate>Fri, 10 Feb 2012 07:05:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2012/2/10/Get-Javascript-value-from-Coldfusion-in-same-page</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>get Table height with javascript</title>
				<link>http://www.ppshein.net/index.cfm/2012/1/19/get-Table-height-with-javascript</link>
				<description>
				
				Normally, it&apos;s hard to get table height with javascript because javascript cannot read or retrieve table as follow

&lt;code&gt;
&lt;table id=&quot;tableID&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;Height&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;script&gt;
&lt;!-- 
	getTableHeight = document.getElementById(&quot;tableID&quot;).offsetHeight;
	alert(getTableHeight)
 --&gt;
&lt;/script&gt;
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Javascript</category>
				
				<pubDate>Thu, 19 Jan 2012 18:29:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2012/1/19/get-Table-height-with-javascript</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Iframe location for firefox</title>
				<link>http://www.ppshein.net/index.cfm/2011/11/29/Iframe-location-for-firefox</link>
				<description>
				
				I oddly know how to use iframe location in firefox. Honestly, most of our projects are based on Internet Explorer. It&apos;s because of ActiveX controls. Why I know how to use iframe location in firefox is because of my junior asked me how to do like that.

&lt;code&gt;
&lt;!--- for IE ---&gt;
window.frames[iframeName].location = url;

&lt;!--- for Firefox ---&gt;
document.getElementById(iframeId).src = url;
&lt;/code&gt;

Credit : &lt;a href=&quot;http://www.dyn-web.com/tutorials/iframes/&quot; target=&quot;_blank&quot;&gt;http://www.dyn-web.com/tutorials/iframes&lt;/a&gt;
				
				</description>
				
				
				<category>Javascript</category>
				
				<pubDate>Tue, 29 Nov 2011 02:40:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/11/29/Iframe-location-for-firefox</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Using parseFloat function in Javascript</title>
				<link>http://www.ppshein.net/index.cfm/2011/7/28/Using-parseFloat-function-in-Javascript</link>
				<description>
				
				Today, I found one of weird problem in my project about using &lt;b&gt;parseFloat()&lt;/b&gt; function of Javascript. The usage of &lt;b&gt;parseFloat() &lt;/b&gt; function parses a string and returns a floating point number. 

&lt;u&gt;example usage of &lt;b&gt;parseFloat() &lt;/b&gt;&lt;/u&gt;
&lt;code&gt;
document.write(parseFloat(&quot;10.33&quot;));
&lt;!--- return value is &quot;10.33&quot; ---&gt;

document.write(parseFloat(&quot;I AM PPSHEIN&quot;));
&lt;!--- return value is &quot;NaN&quot; ---&gt;
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Javascript</category>
				
				<pubDate>Thu, 28 Jul 2011 21:49:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/7/28/Using-parseFloat-function-in-Javascript</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Download Facebook Video Part 2</title>
				<link>http://www.ppshein.net/index.cfm/2011/7/11/Download-Facebook-Video-Part-2</link>
				<description>
				
				I wrote how to download Facebook video &lt;a href=&quot;http://www.ppshein.net/index.cfm/2011/6/12/Download-Facebook-video-without-installing-addons&quot; target=&quot;_blank&quot;&gt;Download Facebook video without installing addons&lt;/a&gt; in my old post. At that time, Facebook using &quot;embed&quot; tag as displaying their video and it&apos;s easy to get original mp4 video from Facebook. Yesterday, one commenter wrote that he cannot download Facebook video regarding the instruction of my previous post. I was confused and cannot understand why he cannot download at all. That&apos;s why I&apos;ve open Facebook video page and reviewed source code of it. Oddly, Facebook don&apos;t use &quot;embed&quot; tag as displaying their video anymore and changed their coding for using javascript as displaying. That&apos;s why I need to find out how to download original mp4 file of this movie from Facebook again.
				 [More]
				</description>
				
				
				<category>Javascript</category>
				
				<category>Facebook</category>
				
				<pubDate>Mon, 11 Jul 2011 05:55:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/7/11/Download-Facebook-Video-Part-2</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Decimal format in Javascript</title>
				<link>http://www.ppshein.net/index.cfm/2011/6/28/Decimal-format-in-Javascript</link>
				<description>
				
				It&apos;s odd that I&apos;ve recently known how to do decimal format in javascript. Because, in the new change requests of our projects, I need to do on-the-fly calculation total amount once users change quantity. It seems so simple to use the built-in function of javascript but value parsing via javascript it a bit touch.

Here is the example.
&lt;code&gt;
&lt;!--- 
	Please assume that &quot;56.50&quot; is in document.myForm.txtPrice.value 
	and quantity is 5.
---&gt;
&lt;/code&gt;

It&apos;s the wrong using of fetching decimal value in JS.
&lt;code&gt;
var getPrice = parseInt(document.myForm.txtPrice.value);
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Coldfusion</category>
				
				<category>Javascript</category>
				
				<pubDate>Tue, 28 Jun 2011 05:12:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/6/28/Decimal-format-in-Javascript</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Change jQueryMobile Select Box active style color in iPad safari</title>
				<link>http://www.ppshein.net/index.cfm/2011/5/19/Change-jQueryMobile-Select-Box-active-style-color-in-iPad-safari</link>
				<description>
				
				Today, I&apos;m very happy that I can change jQueryMobile select Box active style color in iPad safari. Because, current active style &quot;&lt;b&gt;.ui-btn-active&lt;/b&gt;&quot; is 100% working for other inputs like text, radio and checkbox but for select box, it doesn&apos;t completely work in iPad safari. My boss told me that I need to change all of active input color to &quot;dark blue&quot; instead of default color. That&apos;s why I need to change and already played in existing jQueryMobile stylesheet file. But it doesn&apos;t work at all. That&apos;s why I think I need to hack jQueryMobile existing javascript. After 30 minutes, I found that there are three places I need to change in jQueryMobile existing stylesheet. 

The first part is I need to add new class name for active select box in stylesheet.

&lt;code&gt;
.ui-select-active {color:#0000a0; text-shadow: 0 -1px 1px #ffffff;}
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>jQuery</category>
				
				<category>Javascript</category>
				
				<category>jQueryMobile</category>
				
				<category>Stylesheet</category>
				
				<pubDate>Thu, 19 May 2011 22:41:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/5/19/Change-jQueryMobile-Select-Box-active-style-color-in-iPad-safari</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Display image when completely loaded with Javascript</title>
				<link>http://www.ppshein.net/index.cfm/2011/4/28/Display-image-when-completely-loaded-with-Javascript</link>
				<description>
				
				Today, I need to test some simple javascript coding to detect image manipulation. As we all know, we cannot detect Image width and height with javascript or jQuery before which isn&apos;t completely loaded. Now what I want to do is just put &lt;b&gt;loading&lt;/b&gt; text and don&apos;t show image while it&apos;s not completely loaded. It&apos;s quite simple and I feel what I want to do might be useful for my future projects. Because I feel displaying image while loading is annoying and shouldn&apos;t be good for our clients. That&apos;s why I have an idea to do like that.

&lt;code&gt;
&lt;img id=&quot;imageid&quot; src=&quot;very_big_image.jpg&quot;&gt;
&lt;span id=&quot;loadText&quot;&gt;&lt;/span&gt;

/* Below part is Javascript Coding */
document.onreadystatechange=function()
{
	/* 
		if page/dom/image is completely loaded, 
		show image and remove loading text.
	*/
	if (document.readyState == &quot;complete&quot;)
		{
			document.getElementById(&quot;imageid&quot;).style.display = &quot;inline&quot;;
			document.getElementById(&quot;loadText&quot;).innerHTML = &quot;&quot;;
		}
}
/* hide image and display loading while loading */
document.getElementById(&quot;imageid&quot;).style.display = &quot;none&quot;;
document.getElementById(&quot;loadText&quot;).innerHTML = &quot;Loading...&quot;;
&lt;/code&gt;
				
				</description>
				
				
				<category>Javascript</category>
				
				<pubDate>Thu, 28 Apr 2011 00:56:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/4/28/Display-image-when-completely-loaded-with-Javascript</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>To save data into localStorage when Offline</title>
				<link>http://www.ppshein.net/index.cfm/2011/3/13/To-save-data-into-localStorage-when-Offline</link>
				<description>
				
				Today I&apos;ve found how to save the information of your data when offline (when your internet connection is disconnect). That&apos;s same as when Google email work. It&apos;s very useful to use because our submitted data is sometimes lost when our connection is disconnect or offline. Using this feature in HTML5 can prevent these bad situation. The important part is we need to check whether our browser can support &quot;&lt;b&gt;localStorage&lt;/b&gt;&quot; or not. If not support, cannot develop anymore. If support, let&apos;s go.

First of all, we need to create manifest file for &quot;&lt;b&gt;localStorage&lt;/b&gt;&quot;. It&apos;s the main part to let browser know our application will be using &quot;&lt;b&gt;localStorage&lt;/b&gt;&quot;. So, we need to add all of files name we will be using into this manifest file as follow. Current my simple application, I&apos;ve used 2 files called &lt;b&gt;index.html&lt;/b&gt; and &lt;b&gt;lc.js&lt;/b&gt;. So, I need to add as follow

&lt;code&gt;
CACHE MANIFEST
index.html
lc.js
&lt;/code&gt;

Now I need to let our clients know he/she is now online or office with following javascript.

&lt;code&gt;
navigator.onLine ? &quot;online&quot; :&quot;offline&quot;
&lt;/code&gt;

After that, I need to create index.html file. As HTML5 standard, I need to follow the rule of HTML5. 

&lt;code&gt;
&lt;!DOCTYPE HTML&gt;
&lt;html manifest=&quot;/loc.manifest&quot;&gt;  
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>HTML5</category>
				
				<category>Firefox 4</category>
				
				<category>Javascript</category>
				
				<category>HTML</category>
				
				<pubDate>Sun, 13 Mar 2011 19:40:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/3/13/To-save-data-into-localStorage-when-Offline</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Change default submit action with Javascript</title>
				<link>http://www.ppshein.net/index.cfm/2010/12/29/Change-default-submit-action-with-Javascript</link>
				<description>
				
				We have one issue to solve the bugs come back by clients yesterday. The problem is when our client change quantity in input box of the item and press enter, this item is oddly disappeared from the main screen. So, I need to troubleshoot this issue and read through this code again. Obviously, I found that there are two submit buttons in this found.

If there are two submit buttons in a form, do you know which submit button will work when we press enter? 

&lt;code&gt;
&lt;form name=&quot;frmDoubleSubmit&quot; method=&quot;post&quot; action=&quot;index.cfm&quot;&gt;
	&lt;input type=&quot;Text&quot; name=&quot;txtName&quot;&gt;&lt;br&gt;
	&lt;input type=&quot;Submit&quot; name=&quot;btnDelete&quot; value=&quot;Delete&quot;&gt;
	&lt;input type=&quot;Submit&quot; name=&quot;btnSave&quot; value=&quot;Save&quot;&gt;	
&lt;/form&gt;
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Coldfusion</category>
				
				<category>Javascript</category>
				
				<category>HTML</category>
				
				<pubDate>Wed, 29 Dec 2010 17:15:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/12/29/Change-default-submit-action-with-Javascript</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>cfcontinue is same as continue of javascript</title>
				<link>http://www.ppshein.net/index.cfm/2010/10/20/cfcontinue-is-same-as-continue-of-javascript</link>
				<description>
				
				Today, I found that cfcontinue is same as continue of javascript. I&apos;m not sure whether it would be useful or not even you&apos;re trying to use looping. I&apos;m not sure why Adobe add cfcontinue as new tag in Coldfusion 9. I think, it would be useful for somewhere else. But for me, it&apos;s so far to use.
Usage of cfcontinue is just like continue in javascript. If action happen in condition, Coldfusion will skip this action and will continue the rest of looping.
&lt;code&gt;
&lt;cfoutput&gt;
	&lt;cfloop index=&quot;x&quot; from=&quot;1&quot; to=&quot;5&quot;&gt;  
		&lt;cfif x eq 1&gt;    
			Gosh..!! I&apos;ve been caught in #x# 
			&lt;cfcontinue&gt;  
		&lt;/cfif&gt; 
		current count : #x#
	&lt;/cfloop&gt;
&lt;/cfoutput&gt;
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Coldfusion</category>
				
				<category>Javascript</category>
				
				<category>CF Tag</category>
				
				<pubDate>Wed, 20 Oct 2010 21:42:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/10/20/cfcontinue-is-same-as-continue-of-javascript</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Different between setTimeout and setInterval</title>
				<link>http://www.ppshein.net/index.cfm/2010/10/18/different-between-settimeout-and-setinterval</link>
				<description>
				
				In these days, I&apos;m so far to learn for my javascript enhancement. In my last project, I need to write about auto-refresh timer for ChChRart. In these coding, I was supposed to use setTimeOut. Unfortunately, it can&apos;t support my Chart to refresh always. Actually, it can refresh only one time once the page has been rendered. That&apos;s why I tried to use setInterval.

setTimeOut : action will be run (only one time) defined milliseconds are timeout.
setInterval: action will be run always whenever defined milliseconds are timeout.
				 [More]
				</description>
				
				
				<category>Javascript</category>
				
				<pubDate>Mon, 18 Oct 2010 19:07:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/10/18/different-between-settimeout-and-setinterval</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Load Content like Facebook and Twitter</title>
				<link>http://www.ppshein.net/index.cfm/2010/10/14/load-content-like-facebook-and-twitter</link>
				<description>
				
				Today, I found one of the new features of Twitter&apos;s new face is loading content while scrolling like Facebook. I feel it&apos;s cool and the advantage of using is don&apos;t need to fetch all records from database at once and don&apos;t need to use annoying pagination feature (I didn&apos;t say all pagination are annoying). 
Here is how they work with jQuery.
&lt;code&gt;
/* Load jQuery from Google API */
$(document).ready(function(){
    
    /* Alert the height of content */
    alert(&quot;Current Document Height is : &quot; + $(document).height() + &quot;px&quot;);
    
    function AnotherContent() 
    {     
        /* get current Height of content */
        var currentHeight = $(document).height();
        
        /* increase Height of content */
        var IncreaseHeight = currentHeight +  200;        
        $(&apos;#myHeight&apos;).height(IncreaseHeight);
                
        /* Alert the new current height of content */
        alert(&quot;Current Document Height is : &quot; + IncreaseHeight + &quot;px&quot;);    
        
        /* 
            if you wanna load another page, use this script. 
            $(&quot;#myHeight&quot;).load(&quot;index.cfm&quot;);
        */
        
    };  
    
    $(window).scroll(function(){
        /* Load AnotherContent() function when scroll down to the bottom of page. */
        if  ($(window).scrollTop() == $(document).height() - $(window).height()){
           AnotherContent();
        }
    }); 
    
});
&lt;/code&gt;

&lt;code&gt;
&lt;body&gt;
    &lt;table cellpadding=&quot;4&quot; cellspacing=&quot;1&quot; border=&quot;1&quot; height=&quot;640&quot; width=&quot;100%&quot;&gt;
    &lt;tr&gt;
        &lt;td id=&quot;myHeight&quot; valign=&quot;middle&quot; align=&quot;center&quot;&gt;What?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
&lt;/body&gt;
&lt;/code&gt;
				
				</description>
				
				
				<category>jQuery</category>
				
				<category>Javascript</category>
				
				<category>Twitter</category>
				
				<category>Facebook</category>
				
				<pubDate>Thu, 14 Oct 2010 19:22:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/10/14/load-content-like-facebook-and-twitter</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Continue and Break of Javascript</title>
				<link>http://www.ppshein.net/index.cfm/2010/10/3/continue-and-break-of-javascript</link>
				<description>
				
				Currently, I know continue and break is very useful for looping when action happen in condition. Usage of these two commands are just like return for javascript UDF.

Continue : if action happen in condition, javascript will skip this action and will continue the rest of looping
Break :  if action happen in condition, javascript will stop execution the whole looping.

 
Usage of continue

&lt;code&gt;
    var msg = &quot;&quot;;
    for (var x = 0; x &lt;=5; x++)
       {
       if (x == 3)
          {
              /* skipped it once x is equal to 3 */                  
              continue;
          }
       msg = msg + x + &quot;\n&quot;;
       }
    document.write(msg)
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Javascript</category>
				
				<pubDate>Sun, 03 Oct 2010 17:18:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/10/3/continue-and-break-of-javascript</guid>
				
				
			</item>
			
		 	
			</channel></rss>