Talking to .NET on the server with Jaxer
Written by on July 4th, 2008 in Ajax News.
What does your CEO do? Paul Colton, CEO of Aptana, gets his fingers dirty. He just wrote a post about accessing COM objects from JavaScript with Jaxer.
This is possible as the JavaScript is running on the server, and this server is running on Windows. You can download the source code to check it all out.
HTML:
-
-
<script runat=”server-proxy”>
-
function rotate(angle)
-
{
-
var img = COMObject("ImageProcessor.ImageProcessing");
-
-
img.LoadImage(Jaxer.request.documentRoot + "/photo.jpg");
-
img.RotateImage(angle);
-
img.SaveImage(Jaxer.request.documentRoot + "/new.jpg");
-
}
-
</script>
-
<input id=”angle”/>
-
<input type=”button” value=”Rotate”
-
onclick=”rotate(document.getElementById(’angle’).value);
-
document.getElementById(’img’).src =
-
document.getElementById(’img’).src + ‘?’ + new Date()”/>
-
<br />
-
<img id=’img’ src=”new.jpg”/>
-
</body>
-
</html>
-
Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/326599893/talking-to-net-on-the-server-with-jaxer