PDA

View Full Version : dual and triple javascript conflicts



jamienyc
10-30-2009, 02:18 PM
re: dual and triple javascript conflicts

I already tried some suggestions to combine to javascripts, but it hasn't worked out. Perhaps someone here can help.

I have a drop-down menu on a webpage, and just added a Flowplayer video.
Since adding the video, the menu stopped working.

Here's the code:
1. <script type="text/javascript" src="flowplayer-3.1.4.min.js()"></script>

2. <script type="text/javascript" src="menu-files/dhtmlmenu_m1_scr.js()"></script>

How can I get these guys to play together?

If its possible, I'd also like to add a third script:

3: <script type="text/javascript" src="smooth.pack.js"></script>

Thanks in advance. - Jamie NYC

jscheuer1
10-30-2009, 02:32 PM
These are both probably wrong:


1. <script type="text/javascript" src="flowplayer-3.1.4.min.js()"></script>

2. <script type="text/javascript" src="menu-files/dhtmlmenu_m1_scr.js()"></script>

If the filenames for these scripts do not include () at the end there, which they probably don't, these external script tags will not do anything, except possibly cause an error.

The main reason why scripts conflict is a conflict in their onload call. But there can be other reasons as well, instead or in addition to an onload conflict. If it is just an onload conflict, there are various solutions, some better suited to a particular situation than others.

The best way for me to help you would be to see the page with all three scripts on it, with no attempt made by you to get them to play nice together.

Please post a link to the page on your site that contains the problematic code so we can check it out.

jamienyc
10-30-2009, 11:27 PM
Thanks for offering to help.

you'll need this username and password to access the pages: visitor / awr

Here's a link to a page with the conflict.
FYI: this page only has 2 scripts, (the 3 script page is not yet published).
The 2 javascripts are for the DHTML Dynanic Menu and the Flowplayer Video
http://www.humanrightssymbols.org/flowplayer/example/2minute_video.htm

but here is a page with the third script is working correctly with the first script.
The 2 javascripts here are the DHTML Dynanic Menu and a Smooth Scroll Feature
http://www.humanrightssymbols.org/knowpax_disease.htm

Ultimately, there will be a page with all three scripts.

Thanks again - Jamie

jscheuer1
10-31-2009, 04:21 AM
There may be other problems, probably even, though perhaps not. But in any event, on your page:


http://www.humanrightssymbols.org/flowplayer/example/2minute_video.htm

the external script tag for:


dhtmlmenu_m2_scr.js

to wit:


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

is pointing to nothing - if I try to navigate to it I get a 404 not found.

This could simply mean that you didn't actually upload the script file to that location, or - if you did, that the location (path and filename) or case (upper and lower case letters) of the actual path and/or filename for the external script don't agree with that in your src attribute for the external script tag. Or, there could possibly be a server side permission issue(s), though that is fairly unusual.

Upper and lower case almost always matter on the web, almost never on the local machine.

jamienyc
10-31-2009, 08:15 PM
Thank you!

Very cool - adding the menu's required folders into the sub-folder with the html file solved it all. Really nice of you to take the time and have a look.

But here's another question you might know how to answer:

The menu, when it drops down, does not go over the video box. Instead it gets cut off.
http://www.humanrightssymbols.org/flowplayer/example/2minute_video.htm

The same issue has occurred when I embed YouTube videos.
http://www.elizaseyesshop.com/
(on this site choose> News from the menu and then> Videos from the sub-menu.)

Any suggestions...? - Jamie

jscheuer1
10-31-2009, 08:46 PM
You need wmode transparent.

On the human rights page, where you have:


<script>
flowplayer("player", "../flowplayer-3.1.5.swf");
</script>


According to information on the flowplayer forums, you should use:


<script type="text/javascript">
flowplayer("player", {src: "../flowplayer-3.1.5.swf", wmode: "transparent"});
</script>

With the youtube videos, you must add the wmode the 'old fashioned way' -

Loosely from:

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14201

Add in this language to your object/embed tag(s) -

Add the following parameter to the OBJECT tag:


<param name="wmode" value="transparent">

Add the following attribute to the EMBED tag:


wmode="transparent"

jamienyc
11-01-2009, 02:51 AM
you are -so- the man right now :D

Your solution worked perfectly for the Flowplayer page. See here.
http://www.humanrightssymbols.org/flowplayer/example/2minute_video.htm

I'll have a go at the YouTube issue a little later and post the results.

Thanks again!

Here's another question in regards to the drop down menu maybe you can help with:
Depending on which browser you view the site, the drop-down menu behaves differently.

Specifically, in Internet Explorer, the drop-down links open softly as its set to, and also properly appears transparently over background content. However, when viewed in Google Chrome on a PC, and with Safari on a Mac, those features do not work, although the menu does still function. Any ideas on how that can be corrected?

Happy Halloween. - Jamie

jscheuer1
11-01-2009, 05:15 AM
Happy All Saints Day!

OK, the script used for the drop down is a bit dated at least in some regards. Following a hunch, I found this line (around line 39) in the flowplayer/example/menu-files/menu_dom.js file:


if(ns)opObj.style.MozOpacity=(vis&&op!=100)?(op/100):'0.999'

In a local mock-up, changing that line to:


if(ns)opObj.style.opacity=(vis&&op!=100)?(op/100):'0.999'

solves the problem.

But, that file file might be a generated file, no way to tell for sure on this end. If it is, you might have trouble finding it.

However, chances are that it is an actual file. If so, this modification to it will take care of this issue.

jamienyc
11-01-2009, 05:07 PM
That totally did the trick.

It was right there on line 39.

Thanks again. I really appreciate your help.

The plugin generates two javascript files. One is the primary, the other is generated per menu design.

I'll have to remember this modification because I noticed every time I adjust the settings via the Dreamweaver plugin, the primary javascript file gets re-written, and that original "MozOpacity" command reappears.

---but--- something is not working properly when I apply the corrected "opacity" switch for the second site with the YouTube videos.
I'm going to give it more attention during the week. It may simply be an slow page loading issue. First I applied the opacity switch, then I added the "wmode" modification. The result was blank boxes appearing where the YouTube videos were supposed to be. I will look at it in more detail and post an update here. Thanks.

Happy Daylight Savings Time.

- Jamie

jscheuer1
11-01-2009, 06:41 PM
Looks like YouTube (or at least that part of it that serves these videos) is offline at the moment.