473,513 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tricky javascript/activex object problem

The following script if run in Internet Explorer should
display a thumbview of a webpage that you point it to.
To test it, replace test.htm with a valid html file.

The problem I'm having is that I can't get onclick to
fire on the rendered Thumbview object. What's strange
is that onmouseover fires. Can anyone see a way?

<html><head><title>test</title></head>
<body onload="Init()">
<a onclick=alert() href="file:///C:/test.htm">
<object id="Thumbview"
classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92"
width=120 height=100 onclick=alert()>
</object><br><br>this works
</a>
<script>
function Init(){
Thumbview.displayFile('C:\\test.htm');
}
</script>
</body></html>
Jul 23 '05 #1
4 5862
joebob wrote:
The following script if run in Internet Explorer shoulddisplay
a thumbview of a webpage that you point it to.To test it,
replace test.htm with a valid html file. The problem I'm having
is that I can't get onclick tofire on the rendered Thumbview
object. What's strangeis that onmouseover fires. Can anyone
see a way?<html><head><title>test</title></head>
<body onload="Init()">
<a onclick=alert() href="file:///C:/test.htm">
<object id="Thumbview"
classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92"
width=120 height=100 onclick=alert()>
</object><br><br>this works
</a>
<script>
function Init(){
Thumbview.displayFile('C:\\test.htm');
}
</script>
</body></html>


onclick and ondblclick just aren't honored by that ActiveX
component. You can probably get onmousedown working, you'll just
have to set it up so that it doesn't fire repeatedly.

Something like:

Thumbview.onmousedown = function() {
if (!this.mouseDownFired) {
this.mouseDownFired = true;
// do whatever
return true;
}
return false;
}

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available
at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #2
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message news:40***************@agricoreunited.com...
joebob wrote:
The following script if run in Internet Explorer shoulddisplay
a thumbview of a webpage that you point it to.To test it,
replace test.htm with a valid html file. The problem I'm having
is that I can't get onclick tofire on the rendered Thumbview
object. What's strangeis that onmouseover fires. Can anyone
see a way?<html><head><title>test</title></head>
<body onload="Init()">
<a onclick=alert() href="file:///C:/test.htm">
<object id="Thumbview"
classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92"
width=120 height=100 onclick=alert()>
</object><br><br>this works
</a>
<script>
function Init(){
Thumbview.displayFile('C:\\test.htm');
}
</script>
</body></html>


onclick and ondblclick just aren't honored by that ActiveX
component. You can probably get onmousedown working, you'll just
have to set it up so that it doesn't fire repeatedly.

Something like:

Thumbview.onmousedown = function() {
if (!this.mouseDownFired) {
this.mouseDownFired = true;
// do whatever
return true;
}
return false;
}

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available
at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html

Jul 23 '05 #3
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message news:40***************@agricoreunited.com...
joebob wrote:
The following script if run in Internet Explorer shoulddisplay
a thumbview of a webpage that you point it to.To test it,
replace test.htm with a valid html file. The problem I'm having
is that I can't get onclick tofire on the rendered Thumbview
object. What's strangeis that onmouseover fires. Can anyone
see a way?<html><head><title>test</title></head>
<body onload="Init()">
<a onclick=alert() href="file:///C:/test.htm">
<object id="Thumbview"
classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92"
width=120 height=100 onclick=alert()>
</object><br><br>this works
</a>
<script>
function Init(){
Thumbview.displayFile('C:\\test.htm');
}
</script>
</body></html>


onclick and ondblclick just aren't honored by that ActiveX
component. You can probably get onmousedown working, you'll just
have to set it up so that it doesn't fire repeatedly.

Something like:

Thumbview.onmousedown = function() {
if (!this.mouseDownFired) {
this.mouseDownFired = true;
// do whatever
return true;
}
return false;
}

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available
at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Hi Grant,

I discovered that onmousedown works. Also in conjunction with Overlib which is pretty cool.

I haven't done anything to ensure that it doesn't fire repeatedly, but I haven't found that to be a problem. Can you tell me what could cause that to occur? Thank you

Jul 23 '05 #4
joebob wrote:
"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:40***************@agricoreunited.com...

joebob wrote:
> The following script if run in Internet Explorer

shoulddisplay
> a thumbview of a webpage that you point it to.To

test it,
> replace test.htm with a valid html file. The

problem I'm having
> is that I can't get onclick tofire on the rendered

Thumbview
> object. What's strangeis that onmouseover fires.

Can anyone
> see a way?<html><head><title>test</title></head>
> <body onload="Init()">
> <a onclick=alert() href="file:///C:/test.htm">
> <object id="Thumbview"
>

classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92"
> width=120 height=100 onclick=alert()>
> </object><br><br>this works
> </a>
> <script>
> function Init(){
> Thumbview.displayFile('C:\\test.htm');
> }
> </script>
> </body></html>


onclick and ondblclick just aren't honored by that
ActiveX
component. You can probably get onmousedown working,
you'll just
have to set it up so that it doesn't fire repeatedly.

Something like:

Thumbview.onmousedown = function() {
if (!this.mouseDownFired) {
this.mouseDownFired = true;
// do whatever
return true;
}
return false;
}
Hi Grant, I discovered that onmousedown works. Also in
conjunction with Overlib which is pretty cool. I haven't done
anything to ensure that it doesn't fire repeatedly, but I
haven't found that to be a problem. Can you tell me what could
cause that to occur? Thank you


By "fire repeatedly" I mean that the native behavior of the
operating system causes an event like "onmousedown" to fire over
and over again at say, 500ms intervals because the native
behavior of the operating system sends an event every 500ms when
a mouse button is held down. If the onmousedown event doesn't
fire repeatedly if you hold the mouse button down then it's fine.
I wasn't sure if it did. Using an alert() to test made it hard to
determine if the event was firing repeatedly.

Good examples of "repeatedly firing" events are "onkeydown" or
"onkeypress", which _do_ fire over and over again when you hold a
key down. A simple example of this is (IE only):

<form>
<input type="text" onkeydown="putInTa(this);">
<textarea name="output"></textarea>
</form>
<script type="text/javascript">
function putInTa(inp) {
inp.form.elements['output'].value += window.event.keyCode;
}
</script>

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available
at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #5

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

Similar topics

7
2809
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) ...
5
8534
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...
4
2053
by: Guillaume CABANAC | last post by:
Hi everybody, Does anybody know how to access a remote database (say Oracle) from JavaScript code (within a Firefox Extension) ? I know ADO via ActiveX in the IE world and think a similar...
5
1319
by: Nick | last post by:
I have the need to return some data back to the server when a Submit button is pressed on a web page. However I dont want anybody to know about the mechanism for sending the data back, becase it...
8
3625
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
1
8241
by: kret | last post by:
Hi, this is my first post so first of all I would like to say hello :) Now getting to my problem. In my job I have to create an ActiveX control in .NET 1.1 that can be lunched from IE....
0
7265
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,...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7111
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...
0
7539
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...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1605
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 ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
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...

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.