473,651 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript waiting for activex to load before execting

hi all,

i have a strange problem here & i'm not sure how to go about fixing
it. Basically, I have a page with an activex control that gets launch
with JS when a user clicks a "connect" button. Now, all i want to do
is disable the button & change the text while the activex is loading.
now, the code below should work, but what i'm seeing is that the js
doesn't even start executing until the activex is loaded. so, what i'm
expecting is the js to run down the function sequentially so:

-the first 2 lines disable & change the text of the button
-the active loads (the button is still disabled)
-activex done load & i re-enable the button.

what actually happens is: when i hit the button, it sits there & loads
the activex, then runs down the function so the disable & re-enable of
the buttons go really fast. any help would be appriciated!

thanks!

-grant.

<object id="MyAppLaunch " type="applicati on/x-oleobject"
classid="CLSID: 8E0FDFBC-77D4-43a1-9AD4-41F0EA8AFF7C"
codebase="myapp .cab#version=2, 1,0,1">
</object>
<script language="javas cript">
<!--

function DoIt()
{
document.form1. Connect.value = "Please Wait...";
document.form1. Connect.disable d = true;

try{
MyAppLaunch.Lau nch(1,2,3,4,5);
}catch(oExcepti on){window.loca tion.href="myap p.exe";}
}
document.form1. Connect.value = "Connect";
document.form1. Connect.disable d = false;
}
-->
</script>
Jul 23 '05 #1
2 6081
Hi grant,
what actually happens is: when i hit the button, it sits there & loads
the activex, then runs down the function so the disable & re-enable of
the buttons go really fast. any help would be appriciated!


The problem is the way the browser handels its GUI updates. While
running your script, there is no point where control is handed back
to the browser so it can repaint. Therefor the best thing is to make
a small delay in your execution to give the browser some time to repaint
before initializing your object.

function DoIt()
{
document.form1. Connect.value = "Please Wait...";
document.form1. Connect.disable d = true;
window.setTimeo ut("finishIt(); ",100);
}

function FinishIt() {

try{
MyAppLaunch.Lau nch(1,2,3,4,5);
}catch(oExcepti on){
window.location .href="myapp.ex e";}
}
document.form1. Connect.value = "Connect";
document.form1. Connect.disable d = false;
}

-->
</script>

That should do it.

Good luck,
Vincent

Jul 23 '05 #2
Hi Vincent,

you're absolutely right! I put the setTimeout in there & it works like
a charm. thanks!!

-grant

Vincent van Beveren <vi*****@provid ent.remove.this .nl> wrote in message news:<40******* **************@ news.xs4all.nl> ...
Hi grant,
what actually happens is: when i hit the button, it sits there & loads
the activex, then runs down the function so the disable & re-enable of
the buttons go really fast. any help would be appriciated!


The problem is the way the browser handels its GUI updates. While
running your script, there is no point where control is handed back
to the browser so it can repaint. Therefor the best thing is to make
a small delay in your execution to give the browser some time to repaint
before initializing your object.

function DoIt()
{
document.form1. Connect.value = "Please Wait...";
document.form1. Connect.disable d = true;
window.setTimeo ut("finishIt(); ",100);
}

function FinishIt() {

try{
MyAppLaunch.Lau nch(1,2,3,4,5);
}catch(oExcepti on){
window.location .href="myapp.ex e";}
}
document.form1. Connect.value = "Connect";
document.form1. Connect.disable d = false;
}

-->
</script>

That should do it.

Good luck,
Vincent

Jul 23 '05 #3

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

Similar topics

7
2815
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) My code is below. I am getting the following error "MyForm.oNetwork.Value is Null or is not an object". I'm struggling to diagnose what to do next. I'd very much appreciate some help Many thanks <HTML><BODY><FORM NAME="MyForm"...
5
8541
by: mikeyjudkins | last post by:
Ive been banging my head on the wall for hours with this one, hopefully someone will know what Im doing wrong here :\ The Goal: I have an xml file that is generated on the fly via JSP which I want to load into a Microsoft.XMLHTTP ActiveX object and manipulate via javascript on the client side. Data is retreived from the server at the request of the javascript without having to reload the page. The Problem:
7
21289
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
0
1711
by: Kunal | last post by:
Hi all, I have run into a problem that I can't quite figure out. Here is the situation: I have to capture a signature from a WebForm. (The ASP.NET application is running on a TabletPC) Currently only an ActiveX control is available for WebForms, so I embedded it using the "<object>" tag.
26
4294
by: Patient Guy | last post by:
Has anyone written code that successfully manipulates binary file data using Javascript? It might---and in the case of doing I/O, will---make use of browser- specific functions (ActiveX/COM with Internet Explorer, XPCOM/XPConnect with Mozilla/Firefox). I am writing client-side code that will generate binary data for producing a GIF file through an OBJECT element. (The GIF is an image of a line and points on a two-axis plot.)
5
10901
by: punchbag | last post by:
Hi all, There has recently been a new update to internet explorer whereby activex controls now load on a page unactivated. MSDN have a website explaining a workaround where you do away with the <OBJECT> tag in your html and instead use an external Javascript the control will load activated. http://msdn.microsoft.com/library/?url=/workshop/author/dhtml/overview/activating_activex.asp
90
11069
by: charlesmusco | last post by:
Hi all. I have the following problem. I have an xml file, while I will list below and I am trying to add nodes to the xml document based on user input to a form. The XML doc is ... <?xml version="1.0"?> <board> <message>
19
19249
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make things a bit easier. What I need to do is create a playlist and play it using JavaScript. I keep on getting close but not close enough to play the dang files. Has anyone done this before and can shed some light on what worked for them?
3
5609
by: sunbeam | last post by:
Short Description of the Project: we developed a e-learning system for our students. each student has a unique username/password to view the modules he/she should view and nothing more. since we want to give them the opportunity to run these modules from home as well, we are trying to get the USERNAME/COMPUTERNAME as well, so the students, when they sign up for the modules, they can ONLY run the modules fromhome PC. We found a nice...
0
8347
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8694
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.