473,471 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Javascript Function is Never Called?

I'm a Javascript newbie, but I do have some Javascript working.

Here's the code I have on my html page to load javascript:

-----
<script src="http://localhost:8888/js/jquery.js"
type="text/javascript"></script>
<script type="text/javascript"
src="http://localhost:8888/js/jquery.selectCombo1.2.1.js"></script>
<script type="text/javascript"
src="http://localhost:8888/js/your_foundry.js"></script></head>
-----

Here's the _entire_ contents of the "your_foundry.js" file:

-----
$(function(){
$('#foundry_popup').selectCombo('get_units.lasso?s etval=true',
'#units_for_alloy_id_no_');
});
-----

And here's the popup, from the html:

-----
<select id="foundry_popup" name="foundry_popup">
<option value="0" selected>No Item Selected</option>
<option value="14007">Iron</option>
<option value="18521">Brass</option>
<option value="9040">Steel</option>
</select>
-----

The anomaly is that, I can set breakpoints on the javascript in the
your_foundry.js file, and, according to Firebug, the code in that file
is never called, even when I select an item from the popup.

What am I missing?

Thanks very much in advance to all for any info.
Sep 11 '07 #1
7 1695
Vik Rubenfeld wrote:
The anomaly is that, I can set breakpoints on the javascript in the
your_foundry.js file, and, according to Firebug, the code in that file
is never called, even when I select an item from the popup.
I've noticed that behavior more times than I can count. The Firebug team
seems to be concentrating on frilly cosmetic features rather than core
functionality. It's not good at breakpoints and debugging code, but it
sure looks great.
Sep 11 '07 #2
Stevo <pl****@spam-me.comwrote:
I've noticed that behavior more times than I can count. The Firebug team
seems to be concentrating on frilly cosmetic features rather than core
functionality. It's not good at breakpoints and debugging code, but it
sure looks great.
Interesting! Maybe it is getting called. I'll put an alert message in
the selectCombo function, and see if it comes up when I pick a new entry
in the popup...

....no, it didn't come up. It seems like the code isn't being called.
Does my javascript code actually look correct?
Sep 11 '07 #3
Vik Rubenfeld wrote:
<snip>
Does my javascript code actually look correct?
The syntax looks correct. You have violated the specification-declared
naming convention that the $ symbol should only be used as the initial
character in a machine generated Identifiers, but are not the first
novice to make that mistake, and it will not alter how the code executes
as it is just a naming convention.

However, the code you have posted is a call to an obscurely named
function and its argument. Without any information about that function
(its definition, its dependencies, their definitions and dependencies),
or even a statement about what it is supposed to do , there is nothing
that can be said. There is certainly nothing here to suggest that the
outcome you seem to expect would be the result of executing the code you
have posted.

Richard.

Sep 11 '07 #4
"Richard Cornford" <Ri*****@litotes.demon.co.ukwrote:
The syntax looks correct.
<snip>
However, the code you have posted is a call to an obscurely named
function and its argument. Without any information about that function
(its definition, its dependencies, their definitions and dependencies),
or even a statement about what it is supposed to do , there is nothing
that can be said. There is certainly nothing here to suggest that the
outcome you seem to expect would be the result of executing the code you
have posted.
I really appreciate the great feedback from this group.

What I'm trying to do, is get a second dropdown menu to appear via
javascript, with its contents based on what the user selects in the
first dropdown menu. I have about 20 dropdowns on the same html page,
that all have to display this behavior, with an additional dropdown
appearing, based on what the user selects in a previous one.

So far the one I'm trying to use, is a jQuery plugin called selectCombo
(http://code.google.com/p/jqueryselectcombo/).

Is there another approach you might recommend, to get this behavior?

(It seems like I've now gotten selectCombo working with the first popup,
and I can keep working on it to get it to work with the additional ones.
It seems to be exactly what Stevo was saying - Firebug breakpoints don't
work in this case, but the code is running.)
Sep 11 '07 #5
On Sep 12, 10:36 am, The Natural Philosopher <a...@b.cwrote:
<snip>
In the end the way I did drop downs was this. In principle.

I started with a table whose first row was the element the user moved
over to explode the drop down.

The second row contained an additional table of the exploded stuff.

The onmouseover/out stuff was applied to the whole table.

But the thing that got hidden was the second ROW of the table.
<snip>

Didn't you just design a system that could never be operated with a
keyboard?

Sep 12 '07 #6
Henry wrote:
On Sep 12, 10:36 am, The Natural Philosopher <a...@b.cwrote:
<snip>
>In the end the way I did drop downs was this. In principle.

I started with a table whose first row was the element the user moved
over to explode the drop down.

The second row contained an additional table of the exploded stuff.

The onmouseover/out stuff was applied to the whole table.

But the thing that got hidden was the second ROW of the table.
<snip>

Didn't you just design a system that could never be operated with a
keyboard?
Probably. Having a mouse is kind of 'in the spec'.

It also requires you have a screen too, and are not, as it happens
red/green colour blind.

You can be deaf though. I didn't specify any audio stuff at all.

And you might even be black, or female, or a homosexual. There's nothing
racist or geneder specific, or even religion specific about it, It's
just a tad mouseist thats all.

Sep 12 '07 #7
The Natural Philosopher <a@b.cwrote:
In the end the way I did drop downs was this.
<snip>

Thank you very much for this great info.
Sep 13 '07 #8

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

Similar topics

14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
7
by: andrewfsears | last post by:
I have a question: I was wondering if it is possible to simulate the multiple constructors, like in Java (yes, I know that the languages are completely different)? Let's say that I have a class...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
1
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
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
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.