473,289 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

how to use objects created by server.createobject in javascript

hi,

i want to fire an event onunload. in the function for the event i want
to use an object created by ASP's server.createobject.

eg:
<%@language = vbscript%>
<%
set obj1= server.createobject("test.test")
%>
<html>
<script>
----- here i want to use obj1 methods---------
</script>
<body onunload="win_unload">
</body>
</html>

thanks

Mar 27 '06 #1
4 4857
babu17 wrote:
i want to fire an event onunload.
OK.
in the function for the event i want to use an object created by ASP's
server.createobject.
Not possible directly. You can only make an HTTP request that uses the
server-side object (which is probably recreated every time).
eg:
<%@language = vbscript%>
<%
set obj1= server.createobject("test.test")
%>
<html>
<script>
<URL:http://validator.w3.org/>
----- here i want to use obj1 methods---------
See above.
</script>
<body onunload="win_unload">


If this is going to execute something, you probably want win_unload();
PointedEars
Mar 27 '06 #2
how can i make an HTTP request.
You said it is not possible directly. so is there any other method to
get it working.
my intention is to store the timeout value in the database using obj1
methods when the user closes browser.

thanks

Mar 27 '06 #3
how can i make an HTTP request.
You said it is not possible directly. so is there any other method to
get it working.
my intention is to store the timeout value in the database using obj1
methods when the user closes browser.

thanks

Mar 27 '06 #4
babu17 wrote:
how can i make an HTTP request.
Using any `http(s):' URI.
You said it is not possible directly. so is there any other method to
get it working.
What I meant is that it is not possible to access the server-side object
from client-side script directly, because neither one "knows" of the other.
However, client-side script can make an HTTP request that will trigger a
server-side application that accesses the server-side object. This will
work only if the server-side object is somehow global, such as stored in a
server-side session.
my intention is to store the timeout value in the database using obj1
methods when the user closes browser.


Strongly recommended against (search the archives), because it is not at all
reliable: onunload executes code that creates an host object that allows to
make the HTTP request (e.g. an Image or IXMLHttpRequest object), and this
object is used in the process. Note that `onunload' will also be called if
one navigates away from the current document, and other event handlers are
proprietary.

Reconsider your application design instead.
PointedEars
Mar 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mick Turner | last post by:
I have connected to SQL Server database (server-side vbscript) and read some data from the tables. This works correctly. I now have the data in an array (server-side). I have to draw a...
9
by: relaxedrob | last post by:
Howdy All! I am still getting my head around a few base concepts. Any comments or criticisms on the below definitions would be most welcome! A function is an object. JavaScript objects have...
6
by: Andy Wawa | last post by:
Hi, on a simple HTML (not an ASP!)-Site I try to connect to a sql server (MS): <html> <title>Test</title> <head> <script language="javascript"> <!-- Function showForm(){
0
by: vande | last post by:
Hi, I am trying to create com objects in asp.net. The objects are getting created but the context in the object created is null. If I create the same object in asp the object is ok and the...
14
by: mjkahn | last post by:
I've read (and read!) that you shouldn't store objects in Session variables. I've read these reasons: - The object takes up memory that may not be freed until the session times out. Better to...
3
by: ytrewq | last post by:
Should dynamic ("expando") properties be restricted to native and user-defined objects? Or should host objects - such as references to the browser or a plug-in or to the document and its elements -...
13
by: Simon Harvey | last post by:
Hi All, I have a colleague that I wprk with that develops using ASP. I develop using ASP.net. He seems to make sites much faster than me and I am wondering if its because of the two different...
47
by: Max | last post by:
Due to the behaviour of a particular COM object, I need to ensure that a request for a particular ASP page is finalized before another request for the page is processed. Does IIS have a way to...
1
by: tilbyj | last post by:
Hello, I am new to .NET, and am trying to write an application that connects to a DCOM server that we use. Wonderfully (unlike with ASP) I can now import the type library for my DCOM server, and...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.