/    Sign up×
Community /Pin to ProfileBookmark

ok i’ll be the first to admit it.. i’m new at javascript.. quite new. so i know little but from what i’ve read i think my problem is b/c i have 2 onload functions in my coding. so can anyone of you help me out with what i am trying to do.

Basically its going to be my company’s new site and i have a drop down menu and a news script going at the same time but if i have the menu working the news wont work..

i’m not going to put the coding in here yet. b/c it has the old drop down menu which is not being used (which btw does not conflict with the news ticker)

so if any of you are willing to help me out please let me know and i will fix up the coding so you can look at it.. thanx a lot

dave

to post a comment
JavaScript

23 Comments(s)

Copy linkTweet thisAlerts:
@JonaNov 16.2004 — [font=trebuchet ms]It may have been a good idea to have cleaned up your code prior to posting, then given us the address that we can see it for ourselves. That way we wouldn't have to fiddle with buggy code and you wouldn't have to post a long post with large amounts of code. Just a thought. Anyway, you can run two functions onload with the following:[/font]

<i>
</i>&lt;body onload="function1(); function2()"&gt;
Copy linkTweet thisAlerts:
@theunknwnbstrdauthorNov 16.2004 — ok well instead of pasting a bunch of code i just hosted it (temporarily)..

please bear in mind that its not done, there is a bunch of stuff in there just for placeholding..

http://davehenning.20megsfree.com/ESP%20site/Copy%20%282%29%20of%20index.htm

the Express News section on the bottom left is what is conflicting with the menu across the top.. thats why there is no news in there. so if you guys could take a look and see what you think the problem is.


thanx again..

dave
Copy linkTweet thisAlerts:
@JonaNov 16.2004 — [font=trebuchet ms]The news scroller works for me in Mozilla Firefox. Are you using a browser (or are you using a [url=http://www.microsoft.com/ie]proprietary markup and scripting translator[/url])?[/font]
Copy linkTweet thisAlerts:
@theunknwnbstrdauthorNov 16.2004 — your seeing news scrolling? that is wierd. i'm using IE. i might have to try mozilla to see this..
Copy linkTweet thisAlerts:
@JonaNov 16.2004 — [i]Originally posted by theunknwnbstrd [/i]

[B]your seeing news scrolling? that is wierd. i'm using IE. i might have to try mozilla to see this.. [/B][/QUOTE]


[font=trebuchet ms]Yes, I'd suggest Mozilla Firefox. Browse happy and everything will work. ?

I'll have to test it in IE to try to figure out your problem. The code is a bit messy, I would suggest using no JavaScript for your menu at all, and design everything (including the menu, excluding the news ticker) in CSS. This way the site would be more accessible. It doesn't make sense to use tables for layout, because a table is what you should find in an Excel spreadsheet - tabular data.[/font]
Copy linkTweet thisAlerts:
@theunknwnbstrdauthorNov 16.2004 — thats not what i learned.. but i havent been formally taught to do webdesign.. its all self taught. but i have learned that tables work great for layout.. i dont know any other way. i am not a professional web designer as you can tell. i just work for a small company. and i am much better at web design then our current site designer.. look at this ( www.express-inc.com ). its complete garbage but anyway. thanx for your input. and another words of wisdom you have shoot em this way.. thanx man..

dave
Copy linkTweet thisAlerts:
@7studNov 16.2004 — Yes, I'd suggest Mozilla Firefox. Browse happy and everything will work.[/quote]

That hasn't been my experience. I've been using Firefox 1.0 for about a 2 months now, and even though I like the features, I hate to say it, but I don't think it works very well. I use it on win98, and

1) FF takes forever to load

2) Web pages render very slowly and in a piecemeal fashion which exposes all the underlying alt attributes for the images.

2) FF crashes if I try to use the Venkman(Mozilla) javascript debugger, which isn't proving to be much of a problem since the Venkman dubugger doesn't work properly.

3)If I get disconnected from a dial up connection and reconnect, FF isn't able to load any new pages--it seems to get caught in an infinite loading loop, so I have to shut down the browser completely and then relaunch it. That's a pain if I have 5 or 6 pages open, and I have to retrieve them all.

4)Mozilla javascript documentation is seemingly nonexistent.

5)Several other small bugs.

I appreciate the effort the open source community put into the browser, but in my opinion they should stop in at www.php.net and see how to organize a successful open source project.

thats not what i learned.. but i havent been formally taught to do webdesign.. its all self taught. but i have learned that tables work great for layout..[/quote]

Did you ever try to get a 1px border around a table, where the table has no interior cells, similar to the layout at www.yahoo.com? If you ever tried to figure out how to do that with tables, then you would know how difficult it is. I did, and I had to nest something like 5 tables inside each other. On the other hand, with CSS it only requires this:

border: 1px solid blue;

If you are self taught, then it is time self teach yourself some CSS. There are plenty of websites and tutorials for CSS, and the basics are simple to learn.
Copy linkTweet thisAlerts:
@theunknwnbstrdauthorNov 16.2004 — i'll do that.. b/c your right it becomes a huge pain. thanx for your input tho.. any ideas with the conflicting scripts?

once again.. thanx..

dave
Copy linkTweet thisAlerts:
@7studNov 16.2004 — Hi,

First, you have some basic html problems. You have a <div> above your <html> tag? ?

I think the javascript problem starts with this line:

<i>
</i>function start(){
if (document.all) [color="red"]iemarquee(slider)[/color];
else if (document.getElementById)
ns6marquee(document.getElementById('slider'));
else if(document.layers)
ns4marquee(document.slider1.document.slider2);
}

function iemarquee(whichdiv){
iediv=eval(whichdiv)
iediv.style.pixelTop=sheight
iediv.innerHTML=msg
sizeup=iediv.offsetHeight
ieslide()
}


You call the function iemarquee() sending the argument: slider. slider is a variable name, however you never declared a variable named slider nor assigned it a value higher up in the code, so slider is undefined. I think what you meant to do was pass the string "slider" as the argument, which is the 'id' of a <div> created in another script way down the page:

document.write('<div id="slider" style="position:relative;width:'+swidth+';">')

See if that works. ?
Copy linkTweet thisAlerts:
@JonaNov 17.2004 — [i]Originally posted by 7stud [/i]

[B]That hasn't been my experience. I've been using Firefox 1.0 for about a 2 months now, and even though I like the features, I hate to say it, but I don't think it works very well. I use it on win98, and



1) FF takes forever to load



2) Web pages render very slowly and in a piecemeal fashion which exposes all the underlying alt attributes for the images.



2) FF crashes if I try to use the Venkman(Mozilla) javascript debugger, which isn't proving to be much of a problem since the Venkman dubugger doesn't work properly.



3)If I get disconnected from a dial up connection and reconnect, FF isn't able to load any new pages--it seems to get caught in an infinite loading loop, so I have to shut down the browser completely and then relaunch it. That's a pain if I have 5 or 6 pages open, and I have to retrieve them all.



4)Mozilla javascript documentation is seemingly nonexistent.



5)Several other small bugs.



I appreciate the effort the open source community put into the browser, but in my opinion they should stop in at www.php.net and see how to organize a successful open source project.[/b]
[/quote]


[font=trebuchet ms]FF does take longer to load, but that is because IE is virtually part of the operating system -- Firefox is a third-party application. On every computer I've used with Firefox (three Windows XP Professional, two XP Home; one XP Home is a desktop [Hewlett-Packard] the other computers are all laptops [two Compaqs, a Dell, and a Sharp]), there have been no problems with the Venkman JavaScript debugger, and it [i]does[/i] work. Also on every computer I've used the page have loaded at least four times faster [i]prior[/i] to any caching. I don't have dial-up, but occasionally my DSL provider will cut-out (which is very frustrating, I plan on switching soon) and the browser will not be able to find any addresses; however, when the connection is revived, Firefox has no problem in reconnecting. The Mozilla JavaScript documentation is basically the same as that which was located on the Netscape Devedge web site. Thanks to AOL, that site no longer exists; however, I downloaded the documentation on JavaScript (the guide and the core docs) and have them in *.zip format if you'd like me to send them to you. The people at Mozilla are trying to recover these files. The JavaScript documentation at Mozilla is a good reference, to be honest, but I agree it doesn't go into a lot of detail and may not be complete. More organization would be a good idea, but I think Mozilla is getting on the right track. Just me.

Overall, though, I was incorrect. Firefox won't work with all of the proprietary scripting and markup that Internet Explorer will, but that's what makes Firefox more secure. I suppose it's a matter of opinion, but anyone who begins designing with CSS will see that Firefox is not just good because of its features but because of its ability to translate W3C recommendations into visual display properly.[/font]
Copy linkTweet thisAlerts:
@7studNov 17.2004 — there have been no problems with the Venkman JavaScript debugger, and it does work.[/quote]

Well, maybe you can help me then. ? I've used sophisticated debuggers before, so I know how they are supposed to work. With Venkman, I can't even get simple things to function correctly. When I first downloaded it, I tried to follow along with this basic tutorial:

http://www.svendtofte.com/code/learning_venkman/basics.php

On that page, you use the debugger to step through a simple piece of code:
<i>
</i>3: &lt;script&gt;
4: var a=1;
5: function test(a){
6: var t = "passed : ";
7: return t+a;
8: }
9: var b = test(a);
10: document.write("&lt;p&gt;" + b + "&lt;/p&gt;");
11: &lt;/script&gt;


According to the instructions, I pressed STOP on the debugger, and reloaded the page which halted the execution of the javascript at the first line. The tutorial says that will happen at line 3, but it always stopped at line 4 for me. Ok, not a major problem.

Then, the tutorial says:
Press the "Step into" button (or F11), to advance to the next line. The debugger is now halted at line 4, the variable declaration. Try entering "a" in the Interactive Session now, you'll see that the value is void.[/quote]
With the debugger halted at line 4, as expected 'a' is void.
Press Step into one more time, and try entering "a" again, and you'll note that it now has a value (of 1).[/quote]

Well, not quite. Any debugger I've used would show a=1, but Venkman shows me 'void' again:

< 001: a
>$[0] = [void] void

That doesn't appear to be giving me a value of 1 for a. Next, I clicked Step Into again, and line 9) was highlighed in yellow. I typed in 'a' again just to see what would happen, and I got the same thing:

< 0001: a
>$[0] = [void] void

Once again, it doesn't appear that's a value of 1 for a. I typed in 'b', and as expected I got an error saying b was not defined. Then, I typed in 'test(a)'. The tutorial says I should've got:

passed : 1

for test(a). But, I got:

<0001: test(a)
> $[1] = [string] "passed : undefined"

? I clicked Step Into again and it jumped up to line 4). Huh? Why not line 5)? I entered 'a' in again, and this is what I got again:

< 0001: a
>$[0] = [void] void

I clicked Step Into again and advanced to line 5). I typed 'a' in again:

<0001: a
>$[0] = [integer] 1

Finally!! A value of 1 for 'a'. Can anyone explain this debugger's behavior? Why no value for 'a' sooner?

Then, when I click Step Into successively after that, this is what happens:

line 9)

line 6)

line 7)

line 9)

line 10)

It just doesn't seem to make sense. The whole sequence is:

4)

5)

9)

4)

5)

9)

6)

7)

9)

10)

I asked around about that a=void behavior, and another guy said the exact same thing happened to him. Can you get that page of the tutorial to work?

Also, Firefox crashes at some point every time I try that tutorial.
Copy linkTweet thisAlerts:
@JonaNov 17.2004 — [font=trebuchet ms]Hmm, I just realized that I was using the default debugger that came with Firefox -- I tried installing Venkman, but it just said "Could not install because: Retart to complete." I restarted my browser but it didn't show up in the extensions and I can't find it anywhere in any of the menus; how do you install it on Firefox?[/font]
Copy linkTweet thisAlerts:
@7studNov 17.2004 — I don't remember having any install problems with Venkman. You might want to ask over at the Mozilla forums. See, I told you the thing was junk. ?
Copy linkTweet thisAlerts:
@JonaNov 17.2004 — [font=trebuchet ms]lol. Crap. Looks like I got my wakeup call, though -- I need to learn to use a _real_ JavaScript debugger. ? [/font]
Copy linkTweet thisAlerts:
@7studNov 18.2004 — With short scripts, you can read through them and grasp the logic and know what the variable values are, but with big complicated scripts or programs with lots of branching, you have two choices: pull out a pen a paper and start writing down values, which is painstaking work and error prone, or use a debugger with 'watches' set for the variables you want to track.

Let me know if you can get Venkman to work on that tutorial. I tried moving the script to a local file, and then stepping through it with the debugger, but I got the same result: still totally incomprehensible. I can't find any support either. My posts about Venkman at the Mozilla forums went unanswered. That's just another sign of the lack of support that seems to plague the whole Mozilla project. ?
Copy linkTweet thisAlerts:
@JonaNov 18.2004 — [font=trebuchet ms]Looks like it doesn't work with Firefox -- just Mozilla and Netscape. That's what my problem was. I'm checking it out now...

Edit: It seems to be a great debugger, but to be honest I don't think that I need it much... I haven't had any problems with it yet, but if I do I'll try to figure them out and let you know.[/font]
Copy linkTweet thisAlerts:
@7studNov 19.2004 — I haven't had any problems with it yet[/quote]

If you have the time, go to that page I linked, and tell me what happens when you use the debugger to step through that simple program.

Thanks.
Copy linkTweet thisAlerts:
@7studNov 19.2004 — :mad: Ok, I decided to ignore the Venkman interactive window, and instead watch the local variables list to see how the variable 'a' was changing in that simple script I posted, but I had the same problem. So, I decided to unistall Venkman and try reinstalling it. After I unistalled it, I went to this page, to get the Venkman download:

http://www.hacksrus.com/~ginda/venkman/

which is where the official Mozilla page directed me to go. (official mozilla page: http://www.mozilla.org/projects/venkman/venkman-walkthrough.html )

But, when I clicked on the link for the latest version of Venkman, Firefox says that for my computer's protection, it was blocking the website from installing any software. How did you get around that?
Copy linkTweet thisAlerts:
@JonaNov 19.2004 — [font=trebuchet ms]It doesn't work on Firefox -- I tried it like four times. It only works with the Mozilla or Netscape browser (not the Firefox one). I don't know why -- it should work with Firefox, too, but it doesn't recognize it. Anyway, though, a new security feature in Firefox (since 1.0PR) is to block sites from installing software (XPI packages) from any web sites except those on your whitelist. This means you have to go into the settings and add the current site to the whitelist -- usually you can click the bar that pops up and do this very easily.[/font]
Copy linkTweet thisAlerts:
@7studNov 19.2004 — Yep, I finally saw an edit button all the way to the right of the warning message that says FF isn't allowing the install. Clicking on the edit button allows you add the site as 'allowable'.

However, after Venkman seemingly completes the download (there's a progress bar showing when it's complete), the FF dialog window displays an install button, but when I click on install, it says it was unable to download the file from that site:

Reason: Restart to complete.

Is that what is happening to you?
Copy linkTweet thisAlerts:
@JonaNov 19.2004 — [font=trebuchet ms]Yes, that happened to me. That's why I said it does NOT work with Firefox. Only with Mozilla -- the Mozilla Suite -- not Mozilla Firefox. The _other_ Mozilla. It also works with Netscape. Just not Firefox.[/font]
Copy linkTweet thisAlerts:
@7studNov 20.2004 — Well, what the heck. :mad: What about an earlier version of Venkman?
Copy linkTweet thisAlerts:
@JonaNov 20.2004 — [i]Originally posted by 7stud [/i]

[B]Well, what the heck. :mad: What about an earlier version of Venkman? [/B][/QUOTE]


[font=trebuchet ms]I'd suggest getting Netscape 7.2 since you may need it for testing later on anyway. I tried a few of the previous versions of Venkman on Firefox, and they didn't seem to work either. I'm hoping they'll have more support for this - or send the browser with it by default - in the near future.[/font]
×

Success!

Help @theunknwnbstrd spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...