newbie: function body location

A

Alfie

Hi.

I'm looking to learn javascript by looking at a particular website which has
a nice looking menu system.

http://tinyurl.com/yw2uc

I've saved the entire page using firefox which save the *.js files too.

Now I'm looking through the functions but cannot find the bodies of several
functions, for example domWrite() and writeItems() below called in the
script menu.js and Menu.htm.

Where are they?

Are they on the 'server' side and invisible to me?

How can I tell? Is it just through their absense?

Thanks


function switchTab(iTabID) {
if (bMenuFolded) {
foldMenu();
}
if (iTabID == 1) {
if (iCurrentTabID==1) {
allPathArray.length=0;
domWrite('menuParents1',sEmptyPathArray);

writeItems('allSkeletonArray',0,'allMarketsTreeContainer','allPathArray','me
nuParents1');
}
 
A

Alfie

Cycloneous Echevarria said:
Here's the file with the routines you're looking for:
<snip>

Thanks.

Can you tell me why they weren't included in the "automatically" (firefox)
downloaded menu.js?

Also, I can now see there is a reference "Menu_data/Menu.js" in menu.htm,
but how did you find that there was a version in the "menu" directory, or
that this directory even existed?

What is the differnce between "Menu_data/Menu.js" and "Menu/Menu.js" ?

Thanks again.
 
C

Cycloneous Echevarria

The site uses frames. So I just looked into the individual frame
sources and extracted the script sections. So they have a bunch of
directories with a bunch of scripts in them.

Orlando, aka, Cycloneous
 
M

Michael Winter

[snip]
Can you tell me why they weren't included in the "automatically"
(firefox) downloaded menu.js?

It would depend on what exactly you tried to save. I don't use Firefox
though, so I couldn't say without any certainty.
Also, I can now see there is a reference "Menu_data/Menu.js" in
menu.htm, but how did you find that there was a version in the "menu"
directory, or that this directory even existed?

If you look through the HTML, you'll see the line

<script language="JavaScript" src="/menu/menu.js"></script>

By the way, that SCRIPT element should have been written

<script type="text/javascript" src="/menu/menu.js"></script>

as the type attribute is required, whereas the language attribute is
deprecated and should no longer be used.
What is the differnce between "Menu_data/Menu.js" and "Menu/Menu.js" ?

To be honest, you shouldn't really worry. This menu is a bad example. It
is only accessible to people that have CSS and JavaScript enabled, which
can rule out a surprisingly large number of people. The HTML is also badly
structured and not something you should seek to emulate.

To this date, I've only seen one well implemented menu system that is
accessible to all users. It could do with some small revisions, but it is
better than most.

<URL:http://www.gazingus.org/html/Using_Lists_for_DHTML_Menus.html>

If you want to learn JavaScript, pose questions to this group and read
posts made by the regulars. There are some very knowledgeable people
around.

Mike
 
A

Alfie

Michael Winter said:
[snip]
Can you tell me why they weren't included in the "automatically"
(firefox) downloaded menu.js?

It would depend on what exactly you tried to save. I don't use Firefox
though, so I couldn't say without any certainty.
Also, I can now see there is a reference "Menu_data/Menu.js" in
menu.htm, but how did you find that there was a version in the "menu"
directory, or that this directory even existed?

If you look through the HTML, you'll see the line

<script language="JavaScript" src="/menu/menu.js"></script>

I'm sorry if I need spoon feeding, but I can't find that in my html.
In menu.htm I have these lines:

<link rel="stylesheet" href="Header_data/Global-css.htm" type="text/css">
<link rel="stylesheet" href="Menu_data/Menu-css.htm" type="text/css">
<script language="Javascript"
src="Header_data/Interfaces_UserModel.js"></script>
<script language="Javascript" src="Menu_data/Menu.js"></script>
<script language="Javascript" src="Header_data/popup_library.js"></script>
<script language="Javascript" src="Menu_data/menu.js"></script>

I'm baffled as to why I can't find

<script language="JavaScript" src="/menu/menu.js"></script>

in any of the html, obviously I'm missing something obvious. Any ideas?

Thanks.
 
M

Michael Winter

[snip]
If you look through the HTML, you'll see the line

<script language="JavaScript" src="/menu/menu.js"></script>
[snip]

I'm baffled as to why I can't find

<script language="JavaScript" src="/menu/menu.js"></script>

in any of the html, obviously I'm missing something obvious. Any ideas?

You're looking in the wrong file. Assuming the interface in Firefox hasn't
changed that much from Mozilla, bring up the context menu over the menu,
open the "This Frame" sub-menu, then select "View Frame Source". The
SCRIPT element I refer to is the last one before the block of in-line
script content, but as I said, you should forget about it.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top