473,385 Members | 1,445 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,385 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 4859
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.