> -----Original Message-----
> From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 01, 2006 12:43 PM
> To: CF-Talk
> Subject: RE: Set session variables in JS?
> 
> Jim's technique is crutch of it, but instead of actually putting an <img
> />
> tag in your code, you can use something like:
> 
> var oImgGateway = new Image();
> oImgGateway.src = "someurl.cfm?passParam=here";
> 
> This will create an async event that will load the URL in the src property
> to the server.
> 
> The caveat with this approach is that you have no way to really interact
> with the server--basically you can only use it to pass information to the
> server, you won't be able to retrieve information from the server using
> that
> technique.

A (very minor) additional point: this won't work from some older browsers
(Netscape 3.0 for example).  But it should work fine for all browsers that
people actually use.  ;^)

You can also get away with some of the same kind of thing using the DOM -
You could add the image to the page programmatically and thus allow for
bi-directional communication via cookies as in my article.

You might instead add a script element to the page (it's "source" attribute
would reference a CF page) which would, perhaps, return some script that
informs you of the results.  This isn't as nice as the cookie solution since
it's a bit hard to manage but you can send any amount of information.

JavaScript is such an insanely powerful tool.

Jim Davis



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230987
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to