By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,817 Members | 2,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,817 IT Pros & Developers. It's quick & easy.

Updating a database without opening a new window

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a


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.