<?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>ropox.net &#187; Programming</title>
	<atom:link href="http://ropox.net/archives/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://ropox.net</link>
	<description>thoughts from a web engineer</description>
	<lastBuildDate>Tue, 13 Sep 2011 05:57:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>get CKEditor data with Jquery &#8211; no plugin required</title>
		<link>http://ropox.net/archives/28457</link>
		<comments>http://ropox.net/archives/28457#comments</comments>
		<pubDate>Tue, 19 Apr 2011 08:52:13 +0000</pubDate>
		<dc:creator>ropox</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://ropox.net/?p=28457</guid>
		<description><![CDATA[If you are using the CKeditor also with JQuery (not the ckeditor plugin) then at some point you might want to get the editor data without submitting the form.


Related posts:<ol><li><a href='http://ropox.net/archives/1081' rel='bookmark' title='Permanent Link: JQuery wildcard selectors'>JQuery wildcard selectors</a> <small>JQuery wildcard selectors on select boxes, how to reset all...</small></li>
<li><a href='http://ropox.net/archives/15669' rel='bookmark' title='Permanent Link: “Visualize” data as graphs'>“Visualize” data as graphs</a> <small>How do you visualize data in interesting ways but allow...</small></li>
<li><a href='http://ropox.net/archives/20449' rel='bookmark' title='Permanent Link: Getting the page and viewport dimensions using jQuery'>Getting the page and viewport dimensions using jQuery</a> <small>Getting the page and viewport dimensions using jQuery is as...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_brown" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fropox.net%252Farchives%252F28457%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22get%20CKEditor%20data%20with%20Jquery%20-%20no%20plugin%20required%20%23%22%20%7D);"></div>
<p>If you are using the CKeditor also with <a href="http://jquery.com" target="_blank">JQuery </a>(not the ckeditor plugin) then at some point you might want to get the editor data without submitting the form.</p>
<p>after a lot of searching i managed to get the editor data without using the <a href="http://ckeditor.com/blog/CKEditor_for_jQuery" target="_blank">jquery plugin for CKEditor</a>.</p>
<p>So if you are replacing text areas with the common way , e.g.</p>
<pre class="brush: javascript">
var bodyEditorEN = CKEDITOR.replace( &#039;bodyen&#039;, {toolbar : &#039;Basic&#039;});</pre>
<p>and this applies to the html element :</p>
<pre class="brush: html">
&lt;textarea id=&quot;bodyen&quot; cols=&quot;70&quot; rows=&quot;10&quot; name=&quot;bodyen&quot;&gt;&lt;/textarea&gt;
</pre>
<p>then all you need to do to access data with Jquery from the editor is by using the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#getData">getData </a>method from CKEditor:</p>
<pre class="brush: javascript">
var body = CKEDITOR.instances[&#039;bodyen&#039;].getData();
alert(body);
</pre>
<div class="fb-widget" id="fbtb-8bf422875e5d4004a04d6169dc295648" style="border:0; outline:0; padding:0; margin:0; position:relative;" itemscope="" itemid="http://www.freebase.com/id/en/jquery" itemtype="http://www.freebase.com/id/computer/software"> <form class="fb-widget-placeholder" style="border:0; outline:0; padding:0; margin:0;"> <input name="src" value="http://www.freebase.com/widget/topic?track=topicblocks_plugin_tags&amp;mode=content&amp;id=%2Fen%2Fjquery" type="hidden" /> <input name="width" value="413" type="hidden" /> <input name="height" value="285" type="hidden" /> <span style="line-height:1; border:0; outline:0; padding:0; margin:0; display:inline-block; padding:5px; background:#eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;"> <div style="text-align:left; vertical-align:baseline; line-height:1; border:0; outline:0; margin:0 0 5px 5px;"> <a style="text-align:left; vertical-align:baseline; font-family:'Helvetica Neue', Arial, sans-serif; font-size:13px; font-weight:bold; line-height:1.6; text-decoration:none; color:#17b; border:0; outline:0; padding:0; margin:0;" href="http://www.freebase.com/view/en/jquery" target="_blank" > jQuery </a> </div> <div style="vertical-align:top; border:1px solid #ddd; outline:0; padding:0; margin:0; position: relative; width:400px; height:220px; overflow:auto; background-color:#fff"> <img src="http://img.freebase.com/api/trans/image_thumb/en/jquery?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=150&amp;mode=fillcropmid&amp;maxwidth=150" title="jQuery" style="border:0; outline:0; padding: 0; margin: 28px auto; display: block;"> </div> </span> </form> </div>


<p>Related posts:<ol><li><a href='http://ropox.net/archives/1081' rel='bookmark' title='Permanent Link: JQuery wildcard selectors'>JQuery wildcard selectors</a> <small>JQuery wildcard selectors on select boxes, how to reset all...</small></li>
<li><a href='http://ropox.net/archives/15669' rel='bookmark' title='Permanent Link: “Visualize” data as graphs'>“Visualize” data as graphs</a> <small>How do you visualize data in interesting ways but allow...</small></li>
<li><a href='http://ropox.net/archives/20449' rel='bookmark' title='Permanent Link: Getting the page and viewport dimensions using jQuery'>Getting the page and viewport dimensions using jQuery</a> <small>Getting the page and viewport dimensions using jQuery is as...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://ropox.net/archives/28457/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 and CSS3 Readiness Visualization</title>
		<link>http://ropox.net/archives/15662</link>
		<comments>http://ropox.net/archives/15662#comments</comments>
		<pubDate>Tue, 15 Jun 2010 06:57:33 +0000</pubDate>
		<dc:creator>ropox</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Metabloging]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[CSS 3]]></category>
		<category><![CDATA[html 5.0]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=9005</guid>
		<description><![CDATA[Paul Irish and Divya Manian have created a fun visualization on readiness of HTML5 and CSS3 standards in various browsers.
It uses a bunch of the usual CSS cool-suspects: -webkit-gradient, -webkit-transition, -webkit-border-radius, and the like (and -moz/-o too).
The added feature is.... do a mouse scroll on the page:
PLAIN TEXT
JAVASCRIPT:




&#160;


jQuery&#40;document&#41;.bind&#40;'DOMMouseScroll mousewheel', function&#40;e, delta&#41; &#123;


&#160; &#160; var newval,


&#160; [...]


Related posts:<ol><li><a href='http://ropox.net/archives/28258' rel='bookmark' title='Permanent Link: Why We Should Start Using CSS3 and HTML5 Today'>Why We Should Start Using CSS3 and HTML5 Today</a> <small>For a while now, I have taken notice of how...</small></li>
<li><a href='http://ropox.net/archives/7306' rel='bookmark' title='Permanent Link: YouTube and Vimeo turn on HTML5 video tag'>YouTube and Vimeo turn on HTML5 video tag</a> <small>At Google I/O the team showed a demo of YouTube...</small></li>
<li><a href='http://ropox.net/archives/28665' rel='bookmark' title='Permanent Link: 25 jQuery image galleries and slideshow plugins'>25 jQuery image galleries and slideshow plugins</a> <small>For some sites, image galleries are an absolute must. Portfolios...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_brown" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fropox.net%252Farchives%252F15662%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2Fc9N7qP%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22HTML5%20and%20CSS3%20Readiness%20Visualization%20%23%22%20%7D);"></div>
<p><a href="http://html5readiness.com/"><img class="alignnone size-full wp-image-9006" title="html5cssreadiness" src="http://ajaxian.com/wp-content/images/html5cssreadiness.png" alt="html5cssreadiness" width="480" height="275" /></a></p>
<p><a href="http://paulirish.com/">Paul Irish</a> and <a href="http://nimbupani.com/">Divya Manian</a> have created a fun visualization on readiness of HTML5 and CSS3 standards in various browsers.</p>
<p>It uses a bunch of the usual CSS cool-suspects: <code>-webkit-gradient</code>, <code>-webkit-transition</code>, <code>-webkit-border-radius</code>, and the like (and -moz/-o too).</p>
<p>The added feature is&#8230;. do a mouse scroll on the page:</p>
<div class="fb-widget" id="fbtb-1de3a76dac114b718c20163eb2a4d266" style="border:0; outline:0; padding:0; margin:0; position:relative;" itemscope="" itemid="http://www.freebase.com/id/en/javascript" itemtype="http://www.freebase.com/id/computer/programming_language"> <form class="fb-widget-placeholder" style="border:0; outline:0; padding:0; margin:0;"> <input name="src" value="http://www.freebase.com/widget/topic?track=topicblocks_plugin_tags&amp;mode=content&amp;id=%2Fen%2Fjavascript&amp;id=%2Fen%2Fjquery" type="hidden" /> <input name="width" value="413" type="hidden" /> <input name="height" value="285" type="hidden" /> <span style="line-height:1; border:0; outline:0; padding:0; margin:0; display:inline-block; padding:5px; background:#eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;"> <div style="vertical-align:top; border:1px solid #ddd; outline:0; padding:0; margin:0; position: relative; width:400px; height:220px; overflow:auto; background-color:#fff"> <ul style="line-height:1; outline:0; padding:0; margin: 10px auto; list-style-type: none; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; width: 300px; "> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/javascript?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="JavaScript" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> JavaScript</a> </li> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/jquery?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="jQuery" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> jQuery</a> </li> </ul> </div> </span> </form> </div>


<p>Related posts:<ol><li><a href='http://ropox.net/archives/28258' rel='bookmark' title='Permanent Link: Why We Should Start Using CSS3 and HTML5 Today'>Why We Should Start Using CSS3 and HTML5 Today</a> <small>For a while now, I have taken notice of how...</small></li>
<li><a href='http://ropox.net/archives/7306' rel='bookmark' title='Permanent Link: YouTube and Vimeo turn on HTML5 video tag'>YouTube and Vimeo turn on HTML5 video tag</a> <small>At Google I/O the team showed a demo of YouTube...</small></li>
<li><a href='http://ropox.net/archives/28665' rel='bookmark' title='Permanent Link: 25 jQuery image galleries and slideshow plugins'>25 jQuery image galleries and slideshow plugins</a> <small>For some sites, image galleries are an absolute must. Portfolios...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://ropox.net/archives/15662/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and drop file uploads in Gmail using just the specs</title>
		<link>http://ropox.net/archives/15671</link>
		<comments>http://ropox.net/archives/15671#comments</comments>
		<pubDate>Fri, 11 Jun 2010 00:17:56 +0000</pubDate>
		<dc:creator>ropox</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Metabloging]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8987</guid>
		<description><![CDATA[Gmail started off with the awful input type="file" "add more" typical solution that we all know and love. Then they added the ability to select multiple files via Flash.... and now they allow the ability to drag and drop files right onto the message compose using HTML5 standards.

Want to do it too? Check out the [...]


Related posts:<ol><li><a href='http://ropox.net/archives/10030' rel='bookmark' title='Permanent Link: The Beast File- Google'>The Beast File- Google</a> <small>Θέλουμε δε θέλουμε, η Google είναι στη ζωή μας σχεδόν...</small></li>
<li><a href='http://ropox.net/archives/5178' rel='bookmark' title='Permanent Link: Ten Technologies That Will Rock 2010'>Ten Technologies That Will Rock 2010</a> <small> Now that the aughts are behind us, we can...</small></li>
<li><a href='http://ropox.net/archives/7306' rel='bookmark' title='Permanent Link: YouTube and Vimeo turn on HTML5 video tag'>YouTube and Vimeo turn on HTML5 video tag</a> <small>At Google I/O the team showed a demo of YouTube...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_brown" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fropox.net%252Farchives%252F15671%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F9JjyJK%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Drag%20and%20drop%20file%20uploads%20in%20Gmail%20using%20just%20the%20specs%20%23%22%20%7D);"></div>
<p>Ropox: Thats interesting enough, but still to my opinion there is a lot to be made yet.</p>
<p>Gmail started off with the awful <code>input type="file"</code> &#8220;add more&#8221; typical solution that we all know and love. Then they added the ability to select multiple files via Flash&#8230;. and now they <a href="http://gmailblog.blogspot.com/2010/04/drag-and-drop-attachments-onto-messages.html">allow the ability to drag and drop files right onto the message compose</a> using HTML5 standards.</p>
<p><img src="http://3.bp.blogspot.com/_JE4qNpFW6Yk/S79rfcmEd7I/AAAAAAAAAjo/kdH1eFnHVYA/attachments2.png" alt="" /></p>
<p>Want to do it too? <a href="https://developer.mozilla.org/en/Using_files_from_web_applications">Check out the APIs</a> and how you can do it all, including showing the thumbnails:</p>
<pre class="brush: javascript">
function handleFiles(files) {
for (var i = 0; i
var file = files[i];
var imageType = /image.*/;

if (!file.type.match(imageType)) {
continue;
}

var img = document.createElement(&quot;img&quot;);
img.classList.add(&quot;obj&quot;);
img.file = file;
preview.appendChild(img);

var reader = new FileReader();
reader.onload = (function(aImg) { return function(e) { aImg.src = e.target.result; }; })(img);
reader.readAsDataURL(file);
}
}
</pre>
<div class="fb-widget" id="fbtb-dcae12eb54694470b7109bcff8c91db3" style="border:0; outline:0; padding:0; margin:0; position:relative;" itemscope="" itemid="http://www.freebase.com/id/en/google" itemtype="http://www.freebase.com/id/business/business_operation"> <form class="fb-widget-placeholder" style="border:0; outline:0; padding:0; margin:0;"> <input name="src" value="http://www.freebase.com/widget/topic?track=topicblocks_plugin_tags&amp;mode=content&amp;id=%2Fen%2Fgoogle" type="hidden" /> <input name="width" value="413" type="hidden" /> <input name="height" value="285" type="hidden" /> <span style="line-height:1; border:0; outline:0; padding:0; margin:0; display:inline-block; padding:5px; background:#eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;"> <div style="text-align:left; vertical-align:baseline; line-height:1; border:0; outline:0; margin:0 0 5px 5px;"> <a style="text-align:left; vertical-align:baseline; font-family:'Helvetica Neue', Arial, sans-serif; font-size:13px; font-weight:bold; line-height:1.6; text-decoration:none; color:#17b; border:0; outline:0; padding:0; margin:0;" href="http://www.freebase.com/view/en/google" target="_blank" > Google </a> </div> <div style="vertical-align:top; border:1px solid #ddd; outline:0; padding:0; margin:0; position: relative; width:400px; height:220px; overflow:auto; background-color:#fff"> <img src="http://img.freebase.com/api/trans/image_thumb/en/google?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=150&amp;mode=fillcropmid&amp;maxwidth=150" title="Google" style="border:0; outline:0; padding: 0; margin: 28px auto; display: block;"> </div> </span> </form> </div>


<p>Related posts:<ol><li><a href='http://ropox.net/archives/10030' rel='bookmark' title='Permanent Link: The Beast File- Google'>The Beast File- Google</a> <small>Θέλουμε δε θέλουμε, η Google είναι στη ζωή μας σχεδόν...</small></li>
<li><a href='http://ropox.net/archives/5178' rel='bookmark' title='Permanent Link: Ten Technologies That Will Rock 2010'>Ten Technologies That Will Rock 2010</a> <small> Now that the aughts are behind us, we can...</small></li>
<li><a href='http://ropox.net/archives/7306' rel='bookmark' title='Permanent Link: YouTube and Vimeo turn on HTML5 video tag'>YouTube and Vimeo turn on HTML5 video tag</a> <small>At Google I/O the team showed a demo of YouTube...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://ropox.net/archives/15671/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the page and viewport dimensions using jQuery</title>
		<link>http://ropox.net/archives/20449</link>
		<comments>http://ropox.net/archives/20449#comments</comments>
		<pubDate>Tue, 08 Jun 2010 14:22:22 +0000</pubDate>
		<dc:creator>ropox</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://ropox.net/?p=20449</guid>
		<description><![CDATA[Getting the page and viewport dimensions using jQuery is as easy as 1 2 3


Related posts:<ol><li><a href='http://ropox.net/archives/28457' rel='bookmark' title='Permanent Link: get CKEditor data with Jquery &#8211; no plugin required'>get CKEditor data with Jquery &#8211; no plugin required</a> <small>If you are using the CKeditor also with JQuery (not...</small></li>
<li><a href='http://ropox.net/archives/1081' rel='bookmark' title='Permanent Link: JQuery wildcard selectors'>JQuery wildcard selectors</a> <small>JQuery wildcard selectors on select boxes, how to reset all...</small></li>
<li><a href='http://ropox.net/archives/3708' rel='bookmark' title='Permanent Link: Custom info windows with jQuery and Google Maps'>Custom info windows with jQuery and Google Maps</a> <small>Ben Nolan has a writeup on a new feature in...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_brown" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fropox.net%252Farchives%252F20449%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FcrkOnG%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Getting%20the%20page%20and%20viewport%20dimensions%20using%20jQuery%20%23%22%20%7D);"></div>
<p>thats why i Love jquery, cause everything is so simple&#8230;</p>
<p>To get the width and height of the whole page (document), use:</p>
<pre class="brush: javascript">
var pageWidth = $(document).width();
var pageHeight = $(document).height();
</pre>
<p>To get the width and height of the viewport (window), use:</p>
<pre class="brush: javascript">
var viewportWidth = $(window).width();
var viewportHeight = $(window).height();
</pre>
<p>
Opera though has a different approach. with Opera 9.5 $(window).height() returns the document height (more info here)<br />
you can get around this by using</p>
<pre class="brush: javascript">
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
</pre>
<div class="fb-widget" id="fbtb-1f001082efeb4f25a045889e3aba2e24" style="border:0; outline:0; padding:0; margin:0; position:relative;" itemscope="" itemid="http://www.freebase.com/id/en/javascript" itemtype="http://www.freebase.com/id/computer/programming_language"> <form class="fb-widget-placeholder" style="border:0; outline:0; padding:0; margin:0;"> <input name="src" value="http://www.freebase.com/widget/topic?track=topicblocks_plugin_tags&amp;mode=content&amp;id=%2Fen%2Fjavascript&amp;id=%2Fen%2Fjquery&amp;id=%2Fen%2Fopen_source" type="hidden" /> <input name="width" value="413" type="hidden" /> <input name="height" value="285" type="hidden" /> <span style="line-height:1; border:0; outline:0; padding:0; margin:0; display:inline-block; padding:5px; background:#eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;"> <div style="vertical-align:top; border:1px solid #ddd; outline:0; padding:0; margin:0; position: relative; width:400px; height:220px; overflow:auto; background-color:#fff"> <ul style="line-height:1; outline:0; padding:0; margin: 10px auto; list-style-type: none; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; width: 300px; "> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/javascript?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="JavaScript" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> JavaScript</a> </li> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/jquery?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="jQuery" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> jQuery</a> </li> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/open_source?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="Open source" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> Open source</a> </li> </ul> </div> </span> </form> </div>


<p>Related posts:<ol><li><a href='http://ropox.net/archives/28457' rel='bookmark' title='Permanent Link: get CKEditor data with Jquery &#8211; no plugin required'>get CKEditor data with Jquery &#8211; no plugin required</a> <small>If you are using the CKeditor also with JQuery (not...</small></li>
<li><a href='http://ropox.net/archives/1081' rel='bookmark' title='Permanent Link: JQuery wildcard selectors'>JQuery wildcard selectors</a> <small>JQuery wildcard selectors on select boxes, how to reset all...</small></li>
<li><a href='http://ropox.net/archives/3708' rel='bookmark' title='Permanent Link: Custom info windows with jQuery and Google Maps'>Custom info windows with jQuery and Google Maps</a> <small>Ben Nolan has a writeup on a new feature in...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://ropox.net/archives/20449/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs</title>
		<link>http://ropox.net/archives/17137</link>
		<comments>http://ropox.net/archives/17137#comments</comments>
		<pubDate>Sun, 09 May 2010 16:12:54 +0000</pubDate>
		<dc:creator>ropox</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ropox.net/?p=17137</guid>
		<description><![CDATA[It was nice enough in AS2 when you did a simple LoadVars object to get the data from a server side page :


Related posts:<ol><li><a href='http://ropox.net/archives/16145' rel='bookmark' title='Permanent Link: Image upload with AS3 mac problem fix'>Image upload with AS3 mac problem fix</a> <small>I hit my head several times on the wall before...</small></li>
<li><a href='http://ropox.net/archives/75' rel='bookmark' title='Permanent Link: flash to become crawlable'>flash to become crawlable</a> <small>Επιτέλους η Macromedia θα συτεργαστεί με την google και την...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_brown" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fropox.net%252Farchives%252F17137%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F9v3i3O%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Error%20%232101%3A%20The%20String%20passed%20to%20URLVariables.decode%28%29%20must%20be%20a%20URL-encoded%20query%20string%20containing%20name%2Fvalue%20pairs%20%23%22%20%7D);"></div>
<p>It was nice enough in AS2 when you did a simple LoadVars object to get the data from a server side page :</p>
<pre name="code" class="php">
var lv:LoadVars = new LoadVars();
lv.username = "ruliman";
lv.password = "123456";
lv.sendAndLoad("somefile.php",lv,"POST");</pre >

All I had to do is print on my php something like:
<pre name="code" class="php">
&amp;message=something&amp;var1=somethingelse&amp;</pre>
<p>where I was starting with &amp; and ending with &amp; , using name value pairs.</p>
<p>it Was simple , straight forward and everybody got used to it, from Flash designers to php programmers.</p>
<p>In AS3 though things are different.</p>
<pre name="code" class="php">var variables:URLVariables = new URLVariables();
variables.username = "ruliman";
variables.password= "123456";
//
trace(variables.toString());
var request:URLRequest = new URLRequest("somefile.php");
request.method = URLRequestMethod.POST;
request.data = variables;

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;

try{
loader.load(request);
}
catch (error:Error) {
trace("Unable to load URL");
}
</pre>
<p><strong>First you need to STOP starting and ending with &amp;. </strong><br />
You dont need that and in fact , you will get the above <span style="color: #ff0000;">error</span>, leaving you wondering why on earth this is not working</p>
<p>so from AS2 where in php you printed</p>
<pre name="code" class="php">
print "&amp;message=something&amp;var1=somethingelse&amp;";</pre >
now you need to print</p>
<pre name="code" class="php">
print "message=".urlencode(something)."&amp;var1=".urlencode(somethingelse);</pre >
<p>so you loose the &amp; in the beginning and in the end plus you make sure all returned data (apart from variables names) are urlencoded.<br />
Adobe should at least MAKE A DAMN NOTE on this new way of handling the returned data from a url posted page...</p>
<div class="fb-widget" id="fbtb-34f84212e59a4516b7f4b6d34ad2b9e8" style="border:0; outline:0; padding:0; margin:0; position:relative;" itemscope="" itemid="http://www.freebase.com/id/en/actionscript" itemtype="http://www.freebase.com/id/computer/programming_language"> <form class="fb-widget-placeholder" style="border:0; outline:0; padding:0; margin:0;"> <input name="src" value="http://www.freebase.com/widget/topic?track=topicblocks_plugin_tags&amp;mode=content&amp;id=%2Fen%2Factionscript&amp;id=%2Fen%2Fadobe_flash&amp;id=%2Fen%2Fphp" type="hidden" /> <input name="width" value="413" type="hidden" /> <input name="height" value="285" type="hidden" /> <span style="line-height:1; border:0; outline:0; padding:0; margin:0; display:inline-block; padding:5px; background:#eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;"> <div style="vertical-align:top; border:1px solid #ddd; outline:0; padding:0; margin:0; position: relative; width:400px; height:220px; overflow:auto; background-color:#fff"> <ul style="line-height:1; outline:0; padding:0; margin: 10px auto; list-style-type: none; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; width: 300px; "> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/actionscript?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="ActionScript" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> ActionScript</a> </li> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/adobe_flash?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="Adobe Flash" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> Adobe Flash</a> </li> <li style="line-height:1; outline:0; margin: 4px 0; padding:5px; background: #eee; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; "> <a href="" style="font-size: 12px; line-height: 50px; text-decoration: none; color: #17B; font-weight: bold;"> <img src="http://img.freebase.com/api/trans/image_thumb/en/php?pad=1&amp;errorid=%2Ffreebase%2Fno_image_png&amp;maxheight=50&amp;mode=fillcropmid&amp;maxwidth=50" title="PHP" style="border:0; outline:0; padding:0; margin:0 10px 0 0; float: left; border: 1px solid #ccc;"> PHP</a> </li> </ul> </div> </span> </form> </div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://ropox.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>

<p>Related posts:<ol><li><a href='http://ropox.net/archives/16145' rel='bookmark' title='Permanent Link: Image upload with AS3 mac problem fix'>Image upload with AS3 mac problem fix</a> <small>I hit my head several times on the wall before...</small></li>
<li><a href='http://ropox.net/archives/75' rel='bookmark' title='Permanent Link: flash to become crawlable'>flash to become crawlable</a> <small>Επιτέλους η Macromedia θα συτεργαστεί με την google και την...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://ropox.net/archives/17137/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

