470,618 Members | 1,723 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,618 developers. It's quick & easy.

Updating a database without opening a new window

Hi,

I have a Javascript heavy application that I need to record stats from
for each click that the user makes. For all intents and purposes this
is a shopping cart application that employs a neat visual DHTML page
turning. This comprises an online brochure with all content loaded in
to client on page load.
I had to avoid requesting new pages so that I could use this fancy
page-turn feature hence the bulky use of Javascript.

I would like to store my stats directly in to a database (MySQL or SQL
Server probably), but I clearly don't want to be launching a new page
as the animation feature would be lost.

Does anybody have any idea how I can execute some ASP or server-side
Javascript that updates the database without actually opening a new
window?

Thanks for any and all help.

Mark W.

Sep 25 '05 #1
3 1367
Does anybody have any idea how I can execute some ASP or server-side
Javascript that updates the database without actually opening a new
window?

Thanks for any and all help.


hidden iframe ?
Sep 25 '05 #2
hi,

hidden iframe ?


Yes that's the way I habe done it. I have a hidden ifram that gets
information from my javascript and return the information from the
database. I the put the information with javascript / dom in the page
that is visible. So only the informations are transfered.

So long Alexander
Sep 25 '05 #3


MarkW wrote:

Does anybody have any idea how I can execute some ASP or server-side
Javascript that updates the database without actually opening a new
window?


Almost everwhere possible is using an Image object to make a request
var imageForHTTPGET = new Image();
imageForHTTPGET.src = 'whatever.asp?arg1=value1&arg2=value2';
Of course that way you can't receive any information then from the
server back (well unless you wanted the server to answer with an image).

In newer browsers you have XMLHttpRequest (for Mozilla 1.x and later,
Netscape 7 and later, Firefox 1.x, Opera 8.x, Safari 1.2 and later,
Konqueror (3.3 and later I think)) respectively XMLHTTP in IE/Win, see
<http://www.faqts.com/knowledge_base/view.phtml/aid/17226/fid/616>
<http://jibbering.com/2002/4/httprequest.html>
so that way you can make HTTP requests and receive the response the
server makes, allowing you to read out the HTTP response status, the
headers, the response body.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 25 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by D. Alvarado | last post: by
2 posts views Thread by Len4ik | last post: by
2 posts views Thread by Zlatko Matiś | last post: by
reply views Thread by Johnny | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.