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

Home Posts Topics Members FAQ

this vs event.scrElemen t

Hi, i've tried a test code about the Event Listener API but i've some
problem about detaching the element firing the event with IE. Here's my
code:

<html>
<head>
<style type="text/css">
..cliccabile {background-color: #FFCCCC; cursor:pointer; }
..testo {color: #009966;}
</style>
</head>
<body>
<div id="tabella">
<table id="DOMtable">
<tr>
<td id="a" class="cliccabi le">clicca qui 0</td>
<td id="b" class="cliccabi le"><span id="d" class="testo">c licca qui
1</span></td>
</tr>
</table>
</div>
<script type="text/javascript">
<!--
function dump_props(obj, obj_name) {
var result = "";
for (var i in obj)
result += obj_name + "." + i + " = " + obj[i] + "<br />";
result += "<hr />";
return result;
}

function fun(evt){
if (this.className =="cliccabile ") //browser standard
window.alert("t his "+this.id);
else if (evt.srcElement .className=="cl iccabile") //microsoft IE
window.alert("e vt.srcElement "+evt.srcElemen t.id);
document.write( dump_props(this ,"this")+dump_p rops(evt.srcEle ment,"evt.srcEl ement"));
}

if (document.getEl ementById("a"). addEventListene r){ //browser standard
document.getEle mentById("a").a ddEventListener ('click',fun,fa lse);
document.getEle mentById("b").a ddEventListener ('click',fun,fa lse);
}else if (document.getEl ementById("a"). attachEvent){ //microsoft IE
document.getEle mentById("a").a ttachEvent('onc lick',fun);
document.getEle mentById("b").a ttachEvent('onc lick',fun);
}
// -->
</script>
</body>
</html>

When I click the element with id=b using IE it dumps the window object
by this and the span object by evt.srcElement.
Do you know an alternative to this in that case?

Thanks

fusillo
May 26 '06 #1
10 3262
Here's a possible solution for my problem:

<td id="b" class="testo cliccabile">cli cca qui 1</td>

function fun(evt){
if (evt.srcElement &&
evt.srcElement. className.index Of("cliccabile" )>-1) //microsoft IE
window.alert("e vt.srcElement "+evt.srcElemen t.id);
else if (this.className && this.className. indexOf("clicca bile")>-1)
//browser standard
window.alert("t his "+this.id);
document.write( dump_props(this ,"this")+dump_p rops(evt.srcEle ment,"evt.srcEl ement"));
}
May 26 '06 #2
On 26/05/2006 02:56, fusillo wrote:

[snip]

Whilst I realise that what you posted is just an example, there are some
issues with the markup, of which you may not be aware.
<html>
HTML documents should have a document type declaration (DOCTYPE), which
nowadays should be Strict.
<head>
<style type="text/css">
.cliccabile {background-color: #FFCCCC; cursor:pointer; }
.testo {color: #009966;}
When specifying a foreground colour, a background colour should usually
be paired with it (and vice versa). Furthermore, once you set one colour
combination, you should set them all (such as link colours)[1].

It is definitely a mistake to assume that anyone is using the same
default colours as you. Consider a visitor with a desktop theme that is
light-on-dark (as opposed to the usual dark-on-light). If you set a pale
background, overriding their default dark one, but assume that their
foreground colour will be black, which it isn't, you will have just
rendered the document unreadable.

[snip]
<div id="tabella">
This div element would seem to be unnecessary...
<table id="DOMtable">
....and a table element with only one row (or one column) is always
suspect. A table should be used to contain tabular data, nothing more.

[snip]
<script type="text/javascript">
<!--
'Hiding' the contents of script elements has been unnecessary for years.

[snip]
result += "<hr />";
You aren't writing XHTML, so don't use its syntax: <hr> not <hr/>. The
same applies to the line break.

[snip]
function fun(evt){
if (this.className =="cliccabile ") //browser standard
window.alert("t his "+this.id);
else if (evt.srcElement .className=="cl iccabile") //microsoft IE
window.alert("e vt.srcElement "+evt.srcElemen t.id);
document.write( dump_props(this ,"this")+dump_p rops(evt.srcEle ment,"evt.srcEl ement"));
}

if (document.getEl ementById("a"). addEventListene r){ //browser standard
You should use feature detection, rather than assuming that the
getElementById method is supported.

var a, b;

if (document.getEl ementById
&& (a = document.getEle mentById('a'))
&& (b = document.getEle mentById('b'))) {
if (a.addEventList ener) {
/* ... */
} else if (a.attachEvent) {
/* ... */
}
}
document.getEle mentById("a").a ddEventListener ('click',fun,fa lse);
document.getEle mentById("b").a ddEventListener ('click',fun,fa lse);
}else if (document.getEl ementById("a"). attachEvent){ //microsoft IE
document.getEle mentById("a").a ttachEvent('onc lick',fun);
document.getEle mentById("b").a ttachEvent('onc lick',fun);
}


The attachEvent method as currently implemented in IE is broken (in my
opinion). Rather than setting the this operator value to something
useful, namely the element to which the listener is attached, it refers
to the global object. In this instance, it would better to assign a
reference to the listener to the onclick property of the elements:

if (a.addEventList ener) {
/* ... */
} else {
a.onclick = b.onclick
= fun;
}

[snip]

Now, whether you should be using the this operator or the target or
srcElement properties of the event object depends on what you're really
doing. The this operator will always refer to the element to which the
event listener is attached, whereas the target/srcElement property will
refer to the element that dispatched the event (the element that was
clicked). You'll have to choose which is the most appropriate. If you
choose the latter, the listener should be rewritten to something like:

function fun(e) {
var target;

if ((e = e || window.event)
&& (target = e.target || e.srcElement)) {
if (target.classNa me == 'cliccabile') {
alert('Target: ' + target.id);
}
document.write( dump_props(this , 'this')
+ dump_props(targ et, 'Event target'));
}
}

Hope that helps,
Mike
Please refrain from using tabs when posting code to Usenet. Use a couple
of spaces, instead.

[1] If You Pick One Color, Pick Them All
<http://www.w3.org/QA/Tips/color>

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
May 26 '06 #3
fusillo <fu*****@nospam .posi-nega.it> writes:
document.getEle mentById("b").a ttachEvent('onc lick',fun);
....
When I click the element with id=b using IE it dumps the window object
by this and the span object by evt.srcElement.


The IE attachEvent method does not invoke the handler as a property of
the target element, which is why "this" refers to the global object.

You know the object at the time the handler is assigned, so you
should remember it there.

I would use a helper function like:

function addEventHandler (elem, eventtype, handler) {
if (elem.addEventL istener) {
elem.addEventLi stener(eventTyp e, handler, false);
} else if (elem.attachEve nt) {
elem.attachEven t("on"+eventtyp e, function(evt){
return handler.call(el em,evt)});
} else { // or whatever fallback
elem["on"+eventt ype] = handler;
}
}
and then:

addEventHandler (document.getEl ementById("a"), "click", fun);
addEventHandler (document.getEl ementById("b"), "click", fun);

This would ensure that the "this" property refers to the correct
object when the handler is executed.

You should also be aware that "srcElement " is a proprietary IE property,
and the corresponding standard property is "target".
Inside the handler function, you could do:

var tgt = evt.target || evt.srcElement;

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
May 26 '06 #4
I've tried to use the call method of Function object assigning this
explicitly, but i've some problem to detach the listener, actually i
don't find a solution in my new test code. Here's:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
..cliccabile {background-color: #FFCCCC; cursor:pointer; }
..cliccato {background-color: #FF6666;}
..festivo {color: #009966;}
#tabella{backgr ound-color:#FFFFFF;}
</style>
</head>
<body>
<div id="tabella"></div>
<script type="text/javascript">
<!--

function myAddListener(o bj,strtype,list ener,usecapture ){
if (obj.addEventLi stener)
obj.addEventLis tener(strtype,l istener,usecapt ure);
else if (obj.attachEven t){
obj.attachEvent ('on'+strtype,f unction myCall(evt){ window.alert('I
view myCall function'); listener.call(o bj,evt); });
}
//else it throws an Error exception
}

function myRemoveListene r(obj,strtype,l istener,usecapt ure){
if (obj.removeEven tListener)
obj.removeEvent Listener(strtyp e,listener,usec apture);
else if (obj.detachEven t){
myCall(null);
obj.detachEvent ('on'+strtype,m yCall);//I view myCall function but i
don't detach the event
}
//else it throws an Error Exception
}

function myListener(evt) {
window.alert('c lick');
var oldclickedcell= document.getEle mentById('DOMta ble').clickedce ll;
if (oldclickedcell ){

oldclickedcell. className=oldcl ickedcell.class Name.replace('c liccato','clicc abile');
myAddListener(o ldclickedcell,' click',myListen er,false);
}
var
newclickedcell= (this.className &&this.classNam e.indexOf('clic cabile')>-1?this:false);
if (newclickedcell ){

newclickedcell. className=newcl ickedcell.class Name.replace('c liccabile','cli ccato');
myRemoveListene r(newclickedcel l,'click',myLis tener,false);
document.getEle mentById('DOMta ble').clickedce ll=newclickedce ll;
}
}

function handlerGo(table _id){
document.getEle mentById(table_ id).clickedcell =false;
var i=0,j,myrow,myc ell;
while (myrow=document .getElementById (table_id).rows .item(i++)){
j=0;
while (mycell=myrow.c ells.item(j++))
if (mycell.classNa me.indexOf('cli ccabile')>-1)
myAddListener(m ycell,'click',m yListener,false );
else if (mycell.classNa me.indexOf('cli ccato')>-1){
myRemoveListene r(mycell,'click ',myListener,fa lse);
document.getEle mentById(table_ id).clickedcell =mycell;
}
}
}
strtabella="<ta ble id=\"DOMtable\" ><tr><td id=\"2006-5-4\"
class=\"cliccab ile festivo\">4</td><td id=\"2006-5-5\"
class=\"cliccab ile\">5</td></tr></table>";
document.getEle mentById('tabel la').innerHTML= strtabella;
handlerGo('DOMt able');

newclickedcell= document.getEle mentById('DOMta ble').rows.item (0).cells.item( 0);

newclickedcell. className=newcl ickedcell.class Name.replace('c liccabile','cli ccato');
myRemoveListene r(newclickedcel l,'click',myLis tener,false);
document.getEle mentById('DOMta ble').clickedce ll=newclickedce ll;

strtabella="<ta ble id=\"DOMtable\" ><tr><td id=\"2006-5-4\"
class=\"cliccab ile festivo\">4</td><td id=\"2006-5-5\"
class=\"cliccab ile\">5</td></tr></table>";
document.getEle mentById('tabel la').innerHTML= strtabella;
handlerGo('DOMt able');
// -->
</script>
</body>
</html>

I'm conscious about importance of getElementById feature detection, but
i don't care it in this test case.
Every advice to better my programmation style is really
well-appreciated. Thanks for your helps.
Sorry for the tab usage on my previous post.

fusillo
May 27 '06 #5
fusillo <fu*****@nospam .posi-nega.it> writes:
I've tried to use the call method of Function object assigning this
explicitly, but i've some problem to detach the listener, .... function myAddListener(o bj,strtype,list ener,usecapture ){
if (obj.addEventLi stener)
obj.addEventLis tener(strtype,l istener,usecapt ure);
else if (obj.attachEven t){
obj.attachEvent ('on'+strtype,f unction myCall(evt){ window.alert('I
view myCall function'); listener.call(o bj,evt); });
This "function myCall" is a function expression. The "myCall" name is
only visible inside the body of the function.

If you need it later, and you do if you want to detach it, you will
have to store it until it needs to be detached. You could return it
for later use:

/** returns the actual listener to remove with myRemoveListene r */
function myAddListener(o bj,strtype,list ener,usecapture ) {
if (obj.addEventLi stener) {
obj.addEventLis tener(strtype,l istener,usecapt ure);
return listener;
} else if (obj.attachEven t) {
var myCall = function myCall(evt){
window.alert('I view myCall function');
listener.call(o bj,evt);
};
obj.attachEvent ('on'+strtype,m yCall);
return myCall;
}
}

and then myRemoveListene r should work if you pass it the return value
of myAddListeren, and not the original function.
function myRemoveListene r(obj,strtype,l istener,usecapt ure){
if (obj.removeEven tListener)
obj.removeEvent Listener(strtyp e,listener,usec apture);
else if (obj.detachEven t){
obj.detachEvent ("on"+strtype,l istener); // returned listener,
//not original

myCall(null);


There was no myCall in scope

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
May 27 '06 #6
fusillo wrote:
I've tried to use the call method of Function object assigning this
explicitly, but i've some problem to detach the listener, actually i
don't find a solution in my new test code. Here's:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
You should discard XHTML 1.0 Transitional in favor of HTML 4.01 Transitional
(or better: Strict) immediately. You do not need XHTML here at all, and it
only gets you into more trouble than you realize(d).
<head>
<style type="text/css">
This is not supposed to work in XHTML. It is an XML application, therefore
XML stylesheet rules apply. In XML, the stylesheet to be used to render a
document must be defined via an <?xml-stylesheet ... ?> processing
instruction (PI) before the DOCTYPE declaration. This can be facilitated
with

<?xml-stylesheet href="#foo" type="text/css"?>
<!DOCTYPE ...>
<html ...>
<head ...>
...
<style type="text/css" id="foo">
...
</style>
...
</head>

...
</html>

But it is recommended that you refer to an external stylesheet resource
instead (because there is also the PCDATA issue, see below):

<URL:http://www.w3.org/TR/xhtml1/#C_13>

It "works" anyway because you serve XHTML as text/html, instead of the
recommended media type application/xhtml+xml. This will have UAs with
tag soup parsers to parse XHTML as if it were wrongfully error-corrected
HTML. Search the archives.

<URL:http://hixie.ch/advocacy/xhtml>
.cliccabile {background-color: #FFCCCC; cursor:pointer; }
.cliccato {background-color: #FF6666;}
.festivo {color: #009966;}
#tabella{backgr ound-color:#FFFFFF;}
Use Web-safe triplets (#fcc, #f66, #096, #fff), and take heed of
<URL:http://www.w3.org/QA/Tips/color>.
</style>
</head>
<body>
<div id="tabella"></div>
If this was parsed by an XML parser, you could write it as

<div id="tabella"/>

(If this does not work, it is a proof that an XML parser is _not_ used.)
<script type="text/javascript">
Correct.
<!--
This long-ago-obsolete ever-nonsense will get you into trouble when
a) an SGML parser is used to parse this as HTML, or b) an XML parser
is rightfully used to parse what you declared as XHTML.

a) The content model of the HTML `script' element is (and has been) CDATA,
so it is not parsed by the markup parser. However, that means the script
engine is passed the comment delimiter, which should be regarded as a
syntax error. You are relying on a proprietary, hardly documented
ECMAScript extension that allows a script engine to discard this
character sequence (and all characters that follow it up to the line
terminator) if it occurs in a line; this is error-prone.

And RFC2854 (June 2000 CE) eventually obsoleted HTML versions prior to
HTML 3.2 (January 1997 CE), so every HTML UA that can be considered
working MUST know about the `script' element (even if it does not support
client-side scripting). There is no reason for trying to hide anything
here except of the misguided attempt of keeping completely b0rken
software alive. (Do you really want that?)

b) Since the content model of the _XHTML_ `script' element is PCDATA, it is
parsed by the markup parser (in contrast to CDATA content). And an XML
parser regards this as a comment that it is allowed to remove. You
may/will end up with an empty script element, <script />, and have none
of your objects created or identifiers declared.
function myAddListener(o bj,strtype,list ener,usecapture ){
if (obj.addEventLi stener)
obj.addEventLis tener(strtype,l istener,usecapt ure);
else if (obj.attachEven t){
obj.attachEvent ('on'+strtype,f unction myCall(evt){ window.alert('I
view myCall function'); listener.call(o bj,evt); });
}
//else it throws an Error exception
But it does not throw an exception then.
}

function myRemoveListene r(obj,strtype,l istener,usecapt ure){
if (obj.removeEven tListener)
obj.removeEvent Listener(strtyp e,listener,usec apture);
else if (obj.detachEven t){
myCall(null); ^^^^^^^^^^^^ obj.detachEvent ('on'+strtype,m yCall);//I view myCall function but i ^^^^^^ don't detach the event
`myCall' is undefined, and cannot be called.
}
//else it throws an Error Exception
Again, it does not.
}

function myListener(evt) {
window.alert('c lick');
var oldclickedcell= document.getEle mentById('DOMta ble').clickedce ll;
You SHOULD NOT try to augment host objects in order to store user-defined
data; use native objects instead.
if (oldclickedcell ){

oldclickedcell. className=oldcl ickedcell.class Name.replace('c liccato','clicc abile'); myAddListener(o ldclickedcell,' click',myListen er,false);
}
var
newclickedcell= (this.className &&this.classNam e.indexOf('clic cabile')>-1?this:false);

(<URL:http://www.w3.org/TR/xhtml1/#h-4.8>)

An XML parser must regard the character data of the `script' element to end
here because of the `>' which is a specified as a markup character. (Point
b) above and this, is the reason why you get a parse error when you do
not "comment out" the `script' element's content, and you do not get the
error if you "comment it out".)

There are different _reasonable_ ways to avoid that; in recommended order:

1. Declare HTML instead of XHTML, and replace XML syntax with SGML syntax.
Watch that you escape ETAGO (`</') delimiters in the (then) CDATA-typed
script code, preferably via `<\/'.

or

Move the script code to an external resource and include that resource
with <script type="text/javascript" src="external_r esource.js"/> (XHTML),
or <script type="text/javascript" src="external_r esource.js"></script>
(XHTML, and HTML 4.01), respectively.

2. Declare the content of the element to be a CDATA section that is not to
be parsed:

<script type="text/javascript">
<![CDATA[
...
]]>
</script>

3. Escape all markup characters in the script code:

<script type="text/javascript">
...
if (1 &lt;= 2 &amp;&amp; (4 &lt;&lt; 1) &gt;= 3)
{
window.alert(42 );
}
</script>

(2. and 3. are XHTML-only solutions.)
[...]
Source code should be posted so that it does not exceed 80 columns per line.
function handlerGo(table _id){
document.getEle mentById(table_ id).clickedcell =false;
See above. Don't do that.
[...]
strtabella="<ta ble id=\"DOMtable\" ><tr><td id=\"2006-5-4\"
class=\"cliccab ile festivo\">4</td><td id=\"2006-5-5\"
class=\"cliccab ile\">5</td></tr></table>";
document.getEle mentById('tabel la').innerHTML= strtabella;
`innerHTML' is a proprietary property, while document.getEle mentById()
is part of a Web standard. Do not mix both, at least not without
feature-testing each part of the reference.

<URL:http://pointedears.de/scripts/test/whatami#inferen ce>
handlerGo('DOMt able');

newclickedcell= document.getEle mentById('DOMta ble').rows.item (0).cells.item( 0);

Do not use reference worms, see above. And you do not need `.items(...)',
you can use [...] instead; the same goes for `.namedItems(". ..")' which can
be replaced by `["..."]'.
[...]
// -->
</script>
</body>
</html>

I'm conscious about importance of getElementById feature detection, but
i don't care it in this test case.
Your problem. You should always care.
Every advice to better my programmation style is really
well-appreciated.
[x] done
Thanks for your helps.


You are welcome.
PointedEars
--
http://members.ud.com/download/gold/
http://folding.stanford.edu/
http://alien.de/seti/
http://setiathome.ssl.berkeley.edu/
May 27 '06 #7
Thomas 'PointedEars' Lahn <Po*********@we b.de> writes:
fusillo wrote:

<style type="text/css">


This is not supposed to work in XHTML.


XHTML 1.0 Transitional inherits the style element from HTML 4.01.
It should work, as long as the contents are valid PCDATA
<URL:http://www.w3.org/TR/xhtml1/#h-4.8>
<URL:http://www.w3.org/TR/xhtml1/#C_4>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
May 27 '06 #8
Lasse Reichstein Nielsen wrote:
Thomas 'PointedEars' Lahn <Po*********@we b.de> writes:
fusillo wrote:
<style type="text/css">

This is not supposed to work in XHTML.


XHTML 1.0 Transitional inherits the style element from HTML 4.01.
It should work, as long as the contents are valid PCDATA
<URL:http://www.w3.org/TR/xhtml1/#h-4.8>
<URL:http://www.w3.org/TR/xhtml1/#C_4>


Please read my comment in context. I am well aware of the fact that the
`style' element is declared in the XHTML 1.0 (Transitional) DTD(s) (and not
inherited from somewhere). However, for an XML renderer to take notice of
the style rules defined therein, it is required that it is referred to in
an XML-stylesheet PI.

On more thorough reading, you will also observe that I referred to
subsection 4.8 in my followup already, and that I mentioned the possibility
that subsection C.4 states. However, I also referred to subsections C.13
(and C.14) in my followup only a few lines below the text that you quoted
above; those parts of the specification explain in detail (again) that and
why the above is not supposed to work as is in XHTML (where the terms
"XHTML documents delivered as HTML" and "XHTML documents delivered as XML"
as used there, are highly questionable, as is the idea behind the entire
"HTML Compatibility Guidelines").
PointedEars
--
Set truthfulness above everything else.
When a man lies, he kills a part of the world.
-- Merlin (AFAIK)
May 27 '06 #9
Thanks for your useful advises, but i have a dubt about this:

Thomas 'PointedEars' Lahn ha scritto:
You SHOULD NOT try to augment host objects in order to store user-defined
data; use native objects instead.


When i use a native object don't i augumt the window host object in a
web contest?

an example to explain what i itend:

a=new String('hello from italy');
window.alert(wi ndow.a);

So why not adding property to a table object?

May 28 '06 #10

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

Similar topics

7
49570
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. The question is about best practices for passing parameters to an event function. I have, say, the following HTML:
4
12567
by: Eric | last post by:
How can I dynamically assign an event to an element? I have tried : (myelement is a text input) document.getElementById('myelement').onKeyUp = "myfnc(param1,param2,param3)"; document.getElementById('myelement') = new Function("myfnc(param1,param2,param3)");
2
2115
by: Mike | last post by:
I have a textbox where I'm trying to restrict which keys a user can hit. My syntax is onKeyDown="myFunction(event)" To restrict the keys, Netscape requires the event.preventDefault method. Problem is, I'm getting and "undefined" for that method. The event object is ok as I'm able to get event.keyCode fine, but nothing for preventDefault. I've even tried something as simple as onKeyDown="alert(event.preventDefault())", but still get...
10
13916
by: David | last post by:
Is there something that I can use to prevent the a user from dragging something, an image for instance. In IE I can use the ondrag = "return false;", is there a way to achieve the same way with the other browsers? Thanks, David
1
4234
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here. From the log it looks like the problem happens when 2 threads insert 1 record each in the same table and then try to aquire a NS (Next Key Share) lock on the record inserterd by the other thread. Thanks Rohit
8
1787
by: Paul | last post by:
Hi, In a class i built, i fire an event when a field changes. In a webform that has an instance of the class, the event (from the class) is fired and the code is executed. However, my webpage does not reload (postback) after the event fires. How do i get the webform to postback when the event fires (after the code in the event is done executing)? Thank you, Paul
17
10188
by: dan_williams | last post by:
I have the following test web page:- <html> <head><title>Test</title> <script language="Javascript"> <!-- function fnTR() { alert("TR"); }
7
5131
by: Don | last post by:
Getting errors after following the MSDN article on using VB.NET (and VS2005) for "Implementing a Managed OnSave Event Sink" for Exchange Server 2007. Not sure, but part of the problem may be that it's the 64-bit version of Exchange 2007 installed on Windows Server 2003 Enterprise x64, while the Exchange 2007 SDK samples seem mostly geared toward 32-bit. Even at that, I was able to build the TLB and install it into COM+ Component Services,...
5
2296
by: nt5515 | last post by:
im trying to write a program that store a binary tree of possible events in an array. i need to be able to sort the the Events in the array based on the previous event that caused it by the time which they will occur. After the specific time has passed the event will be removed and all other events will be bumped up, all the while new events will be added to the end and sorted by their time. Please Help heres wot i've got so far, i've got...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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
8460
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
8576
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
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.