how to run an asp code in javascript?

T

Tinderbox

I am working on a piece of code for an academic experiment and it
puzzled me for days, any help?

I use javascript to sort a table in a html page. bascially, a user can
click on any attributes and the javascript code will rank the contents
of the table based on that attribute. This is done.

Now I want to record the click information into an access database.
basically, wheneve the user click an attribute, I want to use asp code
to insert the click information (userid, attribute_clicked) into an
access database.

My current solution is use window.open in javascript and in the open
function, I insert the url of the asp. something like this:

var nW = window.open('', 'newwnd', 'width=0,height=0,left=0,top=0');
nW.location.href = "desc.asp?subjectid="+ subjectid + "&item=" +
attributeinfo;
nW = null;


However, the problem is there is always a popup windows appears when
the code was executed.

What i want to know is if there is anyway to let the asp code running
in the background invisibly by user?

Thanks in advance!

Yun
 
P

Paul Davis

I did something similar a while back on a java server.
However, instead of a pop-up I used an Image array.

here is something to get you going.

var logAry = new Array();

function log(message){
var logImg = new Image(1,1);
logImg.src = "http://url.here.com/?message=" + escape(message);
logAry[logAry.length] = logImg;
}

Hope this helps,
 
T

Tinderbox

Perfect, Paul, Thanks a lot!


Paul Davis said:
I did something similar a while back on a java server.
However, instead of a pop-up I used an Image array.

here is something to get you going.

var logAry = new Array();

function log(message){
var logImg = new Image(1,1);
logImg.src = "http://url.here.com/?message=" + escape(message);
logAry[logAry.length] = logImg;
}

Hope this helps,

I am working on a piece of code for an academic experiment and it
puzzled me for days, any help?

I use javascript to sort a table in a html page. bascially, a user can
click on any attributes and the javascript code will rank the contents
of the table based on that attribute. This is done.

Now I want to record the click information into an access database.
basically, wheneve the user click an attribute, I want to use asp code
to insert the click information (userid, attribute_clicked) into an
access database.

My current solution is use window.open in javascript and in the open
function, I insert the url of the asp. something like this:

var nW = window.open('', 'newwnd', 'width=0,height=0,left=0,top=0');
nW.location.href = "desc.asp?subjectid="+ subjectid + "&item=" +
attributeinfo;
nW = null;


However, the problem is there is always a popup windows appears when
the code was executed.

What i want to know is if there is anyway to let the asp code running
in the background invisibly by user?

Thanks in advance!

Yun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top