473,320 Members | 1,744 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,320 software developers and data experts.

A couple language questions

1) I want to test for the existence of a method o.m(), so I tried the line
if (o.m) ...
but the interpreter objects to the missing parentheses on m. (This is in
IE.) What is an appropriate approach for checking the existing of a
function?

2) I've got the following code
window.onresize = function {
....
f();
}
function f() {
....
}
<BODY onload="f();">

My question: if the resize event happens while f is executing, is the first
call to f (onload) flushed from the stack? If not, where in f is execution
resumed after the second call to f takes place in response to the resize
event?

Thanks.

Ken
Jul 20 '05 #1
1 1909

"Ken Kast" <kn*@kenkast.com> wrote in message
news:be**********@gateway.northgrum.com...
1) I want to test for the existence of a method o.m(), so I tried the line
if (o.m) ...
but the interpreter objects to the missing parentheses on m. (This is in
IE.) What is an appropriate approach for checking the existing of a
function?

if (typeof o == 'object' && typeof o.m == 'function') {
// Function exists
}
2) I've got the following code
window.onresize = function {
...
f();
}
function f() {
...
}
<BODY onload="f();">

window.onresize = f; // this is sufficient
My question: if the resize event happens while f is executing, is the first call to f (onload) flushed from the stack? If not, where in f is execution resumed after the second call to f takes place in response to the resize
event?


My guess is that the function will be called twice after the calls have been
queued.
JW

Jul 20 '05 #2

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

Similar topics

2
by: bjs | last post by:
I hope I've got the right group here and apologies if I haven't. I'm a hobby programmer and have just upgraded to Visual Basic.net and have a couple of questions if anybody can help. In VB 6...
3
by: digitalsubjunctive | last post by:
Hey, I just started on Python and have a few questions I couldn't find answers to on the Python site or it's tutorial. 1. I notice a few "compiled python" files (indicated by reddish snake...
1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
2
by: PointNot | last post by:
I'm coding in Dev C++ by bloodshed my questions are.... I want to learn to create GUI windows interfaces, can I do it in here. I've never learned the visual aspect of C++ yet, and would like to...
4
by: Kamen Yotov | last post by:
i have raised this question before, but i can't help it doing it again! why there is no separate newsgroup discussing the c#language, not the .net framework, visual c# etc. i am not that...
1
by: Chad Szymanski | last post by:
1) Is it possible to fix the width of a ListView control column? Ie. the user cannot modify the column from its given width. 2) Is there a way to give an individual TreeNode the option of...
3
by: Ron | last post by:
Hello everyone, I have a couple of questions really quick questions. I am creating a dispatch database. What I would really like to do is have to option of automatically inserting the time...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
0
by: Newish | last post by:
Hi Couple of questions on datagrid 1) Is there a performance issue when using datagrid to display data from a datatable. 2) Is there a security issue when using datagrid to display data...
4
by: somenath | last post by:
Hi All, I have some questions about the process of learning C language. I see in this groups all expert most of the time quote from C standard. 1) My question is do all of you study the C...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.