<?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>Floorplanner Tech Blog &#187; Javascript</title>
	<atom:link href="http://techblog.floorplanner.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.floorplanner.com</link>
	<description>Our latest geek adventures!</description>
	<lastBuildDate>Tue, 16 Mar 2010 18:45:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Introducing js3ds &#8211; a Javascript parser for .3ds</title>
		<link>http://techblog.floorplanner.com/2010/01/27/introducing-js3ds-a-javascript-parser-for-3ds/</link>
		<comments>http://techblog.floorplanner.com/2010/01/27/introducing-js3ds-a-javascript-parser-for-3ds/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:21:16 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[3ds]]></category>
		<category><![CDATA[parsers]]></category>
		<category><![CDATA[webgl]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=907</guid>
		<description><![CDATA[Came home very tired today and saw this tweet by @Sirokos. Now, that of course was a challenge!
In the near future I&#8217;m planning to do some experiments with WebGL and Javascript. Of course I need to be able to load some cool 3DS models then. So&#8230; started coding an hour ago and presto! Basics are [...]]]></description>
			<content:encoded><![CDATA[<p>Came home very tired today and saw <a href="http://twitter.com/Sirokos/status/8208942825">this tweet</a> by @Sirokos. Now, that of course was a challenge!</p>
<p>In the near future I&#8217;m planning to do some experiments with WebGL and Javascript. Of course I need to be able to load some cool 3DS models then. So&#8230; started coding an hour ago and presto! Basics are done within the hour! I admit: I&#8217;ve done a <a href="http://code.google.com/p/lib3ds-actionscript/">Actionscript version</a> some years ago (coded it for <a href="http://blog.papervision3d.org/">Papervision</a>).</p>
<p>The<a href="http://github.com/timknip/js3ds/"> javascript version</a> is very basic still: only meshes (vertices, faces and uv&#8217;s) for now. Materials etc. will follow if I find time.</p>
<p>Again: have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2010/01/27/introducing-js3ds-a-javascript-parser-for-3ds/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Generating thumbnails</title>
		<link>http://techblog.floorplanner.com/2008/11/26/generating-thumbnails/</link>
		<comments>http://techblog.floorplanner.com/2008/11/26/generating-thumbnails/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 06:27:05 +0000</pubDate>
		<dc:creator>Willem van Bergen</dc:creator>
				<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[client-side]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=271</guid>
		<description><![CDATA[I would like to thank you all for helping us build our thumbnail database!  I presume this statement might be in need of some clarification, so bear with me when I go into the technical details on this one.
For every design that is saved on Floorplanner, we create a thumbnail in JPEG format. We [...]]]></description>
			<content:encoded><![CDATA[<p>I would like to thank you all for helping us build our thumbnail database! <br /> I presume this statement might be in need of some clarification, so bear with me when I go into the technical details on this one.</p>
<p>For every design that is saved on Floorplanner, we create a thumbnail in JPEG format. We use these thumbnails for the <a href="http://beta.floorplanner.com/gallery">gallery</a>, and now we have included them on everyone&#8217;s <a href="http://beta.floorplanner.com/dashboard">dashboard</a>. However, for various reasons, we do not have a thumbnail available for every design. However, with your help, we are improving the thumbnail database while you our browsing the site!</p>
<p>The thumbnail images are stored on <a href="http://aws.amazon.com/s3/">Amazon AWS S3</a>. We know the URL that a thumbnail of a design should have, but we do not know if it actually is available. In the latter case, the result is a nasty <em>image not found</em> placeholder on the dashboard. This of course is not acceptable! We cannot know if a thumbnail exists other than doing a request to the URL and see whether we get an image back from Amazon, or a HTTP 404 status. This is a very time-consuming procedure to run server side so we chose to find a client-side solution.</p>
<p>We found that javascript can be used to check if an image exist. An AJAX call cannot be used, because cross-site calls are not supported. However, the javascript <code>Image</code> object <em>can</em> be used for this purpose.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family: Monaco,monospace;"><span style="color: #003366; font-weight: bold;">var</span> img <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
img.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// image was found and loaded successfully</span>
  document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img-tag'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> img.<span style="color: #660066;">src</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
img.<span style="color: #000066;">onerror</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// An error occured while loading the image</span>
  document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img-tag'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/images/thumb-unavailable.jpg'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Setting the src property will trigger the events.</span>
img.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://link.to.amazon.s3/design/thumbnail.jpg'</span><span style="color: #339933;">;</span></pre></div></div>

<p>A nice <em>thumbnail not available</em> image will be shown if the thumbnail file cannot be found on S3. This is much nicer, and the check is completely done client-side! However, we found a way this could even be better by changing the <code>onerror</code> event handler. Instead of displaying a <em>thumbnail not available</em> image, we can simply load a small instance of the Floorplanner application to display a small version of the design. Moreover, we can instruct it to generate a thumbnail JPEG and save it to S3!</p>
<p>So, every time you see a small Floorplanner loading on your dashboard, you are creating a missing thumbnail. Next time, the thumbnail will be available on S3 and there will be no need to start the Floorplanner application. A nice example of <a href="http://en.wikipedia.org/wiki/Distributed_computing">distributed computing</a>, mixed with a hint of <a href="http://setiathome.berkeley.edu/">SETI@home</a>. I like it!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/11/26/generating-thumbnails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag&#8217;n&#039;drop from HTML to Flash</title>
		<link>http://techblog.floorplanner.com/2008/11/06/dragndrop-from-html-to-flash/</link>
		<comments>http://techblog.floorplanner.com/2008/11/06/dragndrop-from-html-to-flash/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 10:42:12 +0000</pubDate>
		<dc:creator>Gert-Jan van der Wel</dc:creator>
				<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[drag]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[externalinterface]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=247</guid>
		<description><![CDATA[Last week we released a new Floorplanner account, the Enterprise account. With it, companies can have an online Floorplanner solution completely branded to their wishes. It includes the Roomplanner module and a custom library of their own furniture elements.  Steelcase and Maxon are the first to have an active Enterprise account.

The interesting part of this [...]]]></description>
			<content:encoded><![CDATA[<p>Last week we released a new Floorplanner account, the <a href="http://beta.floorplanner.com/products/comparison">Enterprise account</a>. With it, companies can have an online Floorplanner solution completely branded to their wishes. It includes the Roomplanner module and a custom library of their own furniture elements.  <a href="http://steelcase.floorplanner.com">Steelcase</a> and <a href="http://maxon.floorplanner.com">Maxon</a> are the first to have an active Enterprise account.</p>
<div style="float:right;margin-left:10px;margin-bottom:10px;border:1px solid #ccc;"><img title="drag-n-drop" src="http://techblog.floorplanner.com/wp-content/uploads/2008/11/afbeelding-7.png" alt="" width="296" height="150" /></div>
<p>The interesting part of this release, from a tech point of view, is the new drag-and-drop functionality. The Roomplanner is running in the Flash Player. However, the library of furniture elements is in HTML. We chose to build the furniture library in the HTML sidebar for a couple of reasons. It&#8217;s not in the Roomplanner, so there is more space left to design. It gives us more freedom in the page layout. All items on the page are indexed and things like sorting and tags we&#8217;re easier to build in Ruby on Rails than in Flash.</p>
<p>Now we only needed a way to get the furniture from the sidebar to the Roomplanner. That&#8217;s where the drag&#8217;n'drop comes in, drag from HTML and drop in Flash. To drag an image of a furniture element in HTML we used the fantastic JavaScript <a href="http://script.aculo.us/">script.aculo.us</a> framework. The next step was to swap the image to an element in the Roomplanner and to update the position of the element while moving the cursor on the Flash content. For this we used ExternalInterface to communicate between JavaScript and ActionScript. That&#8217;s all there is to it. The theory is actually quite simple, but in practice it was very (I repeat, VERY) difficult to get it working in all the main browsers. All those nitty gritty browser details&#8230;</p>
<p>At this moment everything seems to work just fine, so please take a look at <a href="http://steelcase.floorplanner.com">Steelcase</a> and/or <a href="http://maxon.floorplanner.com">Maxon</a> and let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/11/06/dragndrop-from-html-to-flash/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using setInterval in a JavaScript class</title>
		<link>http://techblog.floorplanner.com/2008/07/16/using-setinterval-in-a-javascript-class/</link>
		<comments>http://techblog.floorplanner.com/2008/07/16/using-setinterval-in-a-javascript-class/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 10:13:48 +0000</pubDate>
		<dc:creator>Gert-Jan van der Wel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[setInterval]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=98</guid>
		<description><![CDATA[I just figured out how to use setInterval in a JavaScript class. This little snippet shows how I used setInterval in a recursive way.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function MyClass&#40;&#41; &#123;&#125;
&#160;
MyClass.prototype.doNext = function&#40; pArray &#41; &#123;
	clearInterval&#40; this.interval &#41;;
&#160;
	if&#40; pArray.length &#62; 0 &#41; &#123;
		// do something with the array record
		this.doSomething&#40; pArray.pop&#40;&#41; &#41;;
&#160;
		// call this function again in a couple of milliseconds
		var [...]]]></description>
			<content:encoded><![CDATA[<p>I just figured out how to use setInterval in a JavaScript class. This little snippet shows how I used setInterval in a recursive way.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="javascript" style="font-family: Monaco,monospace;"><span style="color: #003366; font-weight: bold;">function</span> MyClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
&nbsp;
MyClass.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">doNext</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> pArray <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	clearInterval<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">interval</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> pArray.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// do something with the array record</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">doSomething</span><span style="color: #009900;">&#40;</span> pArray.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// call this function again in a couple of milliseconds</span>
		<span style="color: #003366; font-weight: bold;">var</span> scope <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> milliseconds <span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">interval</span> <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> scope.<span style="color: #660066;">doNext</span><span style="color: #009900;">&#40;</span> pArray <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> milliseconds <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span> 
&nbsp;
MyClass.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">doSomething</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> pRecord <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// do something</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myObj <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> MyClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
myObj.<span style="color: #660066;">doNext</span><span style="color: #009900;">&#40;</span> myArray <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/07/16/using-setinterval-in-a-javascript-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consume SOAP web service from Javascript</title>
		<link>http://techblog.floorplanner.com/2008/04/02/consume-soap-web-service-from-javascript/</link>
		<comments>http://techblog.floorplanner.com/2008/04/02/consume-soap-web-service-from-javascript/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 15:47:53 +0000</pubDate>
		<dc:creator>Gert-Jan van der Wel</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[NuSOAP]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/consume-soap-web-service-from-javascript.html</guid>
		<description><![CDATA[I wanted to get some data from a web service using Javascript. I looked at several Javascript classes (like this), but because the web service was running on another server it got a little troublesome. As a solution I tried to call the web service through a proxy, but that didn&#8217;t make it any easier.
Jaap [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to get some data from a web service using Javascript. I looked at several Javascript classes (like <a href="http://www.codeproject.com/KB/ajax/JavaScriptSOAPClient.aspx">this</a>), but because the web service was running on another server it got a little troublesome. As a solution I tried to call the web service through a proxy, but that didn&#8217;t make it any easier.</p>
<p>Jaap suggested to take a look at <a href="http://sourceforge.net/projects/nusoap/">NuSOAP</a>, a -kinda old- SOAP toolkit for PHP. With an AJAX request I could call a PHP page that uses NuSOAP to consume the web service. It was actually easier then I thought it would be.</p>
<p>To make the AJAX call from Javascript I used <a href="http://prototypejs.org/">Prototype</a> and this script:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family: Monaco,monospace;">  <span style="color: #003366; font-weight: bold;">function</span> doRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;ajax/consume_webservice.php&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> param1 <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;value1&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> param2 <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;value2&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;param1=&quot;</span><span style="color: #339933;">+</span> param1 <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&amp;param2=&quot;</span><span style="color: #339933;">+</span> param2<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #660066;">Request</span> <span style="color: #009900;">&#40;</span> url<span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> method<span style="color: #339933;">:</span> <span style="color: #3366CC;">'POST'</span><span style="color: #339933;">,</span> parameters<span style="color: #339933;">:</span> params<span style="color: #339933;">,</span>
      onComplete<span style="color: #339933;">:</span> onResult <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> onResult<span style="color: #009900;">&#40;</span> result <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> result.<span style="color: #660066;">responseText</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>The PHP file consume.php looks something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: Monaco,monospace;"><span style="color: #339933;">&lt;</span> ?php
&nbsp;
  <span style="color: #000088;">$param1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$POST_</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'param1'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$POST_</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'param1'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$param2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$POST_</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'param2'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$POST_</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'param2'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// this is the only file I used from the NuSOAP project</span>
  <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;nusoap.php&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> webserviceurl<span style="color: #339933;">;</span>
  <span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;param1&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$param1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;param2&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$param2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$soap</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> nusoap_client<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">60</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$proxy</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$soap</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getProxy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$proxy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">functionname</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$params</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$proxy</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>That&#8217;s all. Do a AJAX request from Javascript to a PHP page. Then the PHP page uses NuSOAP to consume the web service and returns the result. Back in Javascript you can do whatever you want with the given data.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/04/02/consume-soap-web-service-from-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
