<?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>Paul Brunt &#187; ajax</title>
	<atom:link href="http://www.paulbrunt.co.uk/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulbrunt.co.uk</link>
	<description>faster, better; faster, better!</description>
	<lastBuildDate>Sun, 24 Jan 2010 13:57:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Essential AJAX Functions</title>
		<link>http://www.paulbrunt.co.uk/2008/09/17/essential-ajax-functions/</link>
		<comments>http://www.paulbrunt.co.uk/2008/09/17/essential-ajax-functions/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 14:14:52 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.paulbrunt.co.uk/?p=97</guid>
		<description><![CDATA[Okay here are a couple of really usefull javascript functions when it come to ajax. Though having recently decoverd jquery I may use a little less now:
This one is cross browser and will retrive and xmldoc from a given url:

function loadXMLDoc(url) {
req = false;
// branch for native XMLHttpRequest object
if(window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch(e) [...]]]></description>
			<content:encoded><![CDATA[<p>Okay here are a couple of really usefull javascript functions when it come to ajax. Though having recently decoverd jquery I may use a little less now:<span id="more-97"></span></p>
<p>This one is cross browser and will retrive and xmldoc from a given url:</p>
<p><code><br />
function loadXMLDoc(url) {<br />
req = false;<br />
// branch for native XMLHttpRequest object<br />
if(window.XMLHttpRequest) {<br />
try {<br />
req = new XMLHttpRequest();<br />
} catch(e) {<br />
req = false;<br />
}<br />
// branch for IE/Windows ActiveX version<br />
} else if(window.ActiveXObject) {<br />
try {<br />
req = new ActiveXObject("Msxml2.XMLHTTP");<br />
} catch(e) {<br />
try {<br />
req = new ActiveXObject("Microsoft.XMLHTTP");<br />
} catch(e) {<br />
req = false;<br />
}<br />
}<br />
}<br />
if(req) {<br />
req.open("GET", url, false);<br />
req.send("");<br />
}<br />
return req.responseXML<br />
}<br />
</code></p>
<p>This will send a doucment to a url and return a textstring responce:</p>
<p><code><br />
function sendXMLDoc(url,doc) {<br />
req = false;<br />
// branch for native XMLHttpRequest object<br />
if(window.XMLHttpRequest) {<br />
try {<br />
req = new XMLHttpRequest();<br />
} catch(e) {<br />
req = false;<br />
}<br />
// branch for IE/Windows ActiveX version<br />
} else if(window.ActiveXObject) {<br />
try {<br />
req = new ActiveXObject("Msxml2.XMLHTTP");<br />
} catch(e) {<br />
try {<br />
req = new ActiveXObject("Microsoft.XMLHTTP");<br />
} catch(e) {<br />
req = false;<br />
}<br />
}<br />
}<br />
if(req) {<br />
req.open("POST", url, false);<br />
req.send(doc);<br />
}<br />
return req.responseText<br />
}<br />
</code></p>
<p>Note: I can&#8217;t remember where these came from I don&#8217;t remember writing them.<br />
So, if you think you did and you would like me to credit or remove please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2008/09/17/essential-ajax-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
