/    Sign up×
Community /Pin to ProfileBookmark

How can I run both of these scripts?

<html>
<head>
<script language=”JavaScript”>
<!–
function mmLoadMenus() {
if (window.mm_menu_1009233220_0) return;
window.mm_menu_1009233220_0 = new Menu(“root”,153,20,”Verdana, Arial, Helvetica, sans-serif”,10,”#000000″,”#cccccc”,”#cc0000″,”#000000″,”left”,”middle”,2,1,500,-96,20,true,false,true,0,false,false);
mm_menu_1009233220_0.addMenuItem(“song1′”,”location=’http://www.yours.com/song1.m3u‘”);
mm_menu_1009233220_0.addMenuItem(“song2”,”location=’http://www.yours.com/song2.m3u‘”);
mm_menu_1009233220_0.addMenuItem(“song3”,”location=’http://www.yours.com/song3.m3u‘”);
mm_menu_1009233220_0.hideOnMouseOut=true;
mm_menu_1009233220_0.menuBorder=0;
mm_menu_1009233220_0.menuLiteBgColor=’#e0dfe3′;
mm_menu_1009233220_0.menuBorderBgColor=’#555555′;
mm_menu_1009233220_0.bgColor=’#ffffff’;

mm_menu_1009233220_0.writeMenus();
} // mmLoadMenus()

//–>
</script>
<script language=”JavaScript1.2″ src=”mm_menu.js”></script>

<script language=”JavaScript”>
<!–
function mmLoadMenus() {
if (window.mm_menu_1010061330_0) return;
window.mm_menu_1010061330_0 = new Menu(“root”,78,20,”Verdana, Arial, Helvetica, sans-serif”,9,”#000000″,”#cccccc”,”#cc0000″,”#000000″,”left”,”middle”,2,1,500,-96,20,true,false,true,0,true,false);
mm_menu_1010061330_0.addMenuItem(“song4”,”location=’http://www.yours.com/song4.m3u‘”);
mm_menu_1010061330_0.hideOnMouseOut=true;
mm_menu_1010061330_0.menuBorder=0;
mm_menu_1010061330_0.menuLiteBgColor=’#e0dfe3′;
mm_menu_1010061330_0.menuBorderBgColor=’#555555′;
mm_menu_1010061330_0.bgColor=’#ffffff’;

mm_menu_1010061330_0.writeMenus();
} // mmLoadMenus()

//–>
</script>
<script language=”JavaScript1.2″ src=”mm_menu.js”></script>

</head>
<body>
<script language=”JavaScript1.2″>mmLoadMenus();</script>
<a href=”#” onMouseOut=”MM_startTimeout();” onMouseOver=”MM_showMenu(window.mm_menu_1009233220_0,0,-60,null,’audio’);”><img name=”audio” src=”audio.gif” width=”14″ height=”14″ border=”0″ alt=””></a>

<script language=”JavaScript1.2″>mmLoadMenus();</script>
<a href=”#” onMouseOut=”MM_startTimeout();” onMouseOver=”MM_showMenu(window.mm_menu_1010061330_0,0,-20,null,’audio’);”><img name=”audio” src=”audio.gif” width=”14″ height=”14″ border=”0″ alt=””></a>

</body>
</html>

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@steelersfan88Oct 10.2004 — You have to rename the second one of these: <script language="JavaScript1.2" src="mm_menu[b]2[/b].js"></script> . Then, rename you second function to mmLoadMenus[b]2[/b].

Now, you'll have to duplicate the JS file, so you have a regular, and a 2 (mm_menu and mm_menu2). All of the functions in the mm_menu2.js file should end with a [b]2[/b].

Then, your second link/image, change the functions in the onmouseout and onmouseover functions to [...][b]2[/b].

(Note this is the easier, but not the best way. The ebst way would involve sending the item as an argument ... maybe tooconfusing, so I didn't get into it)
Copy linkTweet thisAlerts:
@GenerationXauthorOct 10.2004 — Something is still wrong. I don't get any errors but now the menus will not show what am I doing wrong???


<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Untitled Document</title>

<script language="JavaScript">

<!--

function mmLoadMenus() {

if (window.mm_menu_1009233220_0) return;

window.mm_menu_1009233220_0 = new Menu("root",153,10,"Verdana, Arial, Helvetica, sans-serif",9,"#000000","#cccccc","#cc0000","#000000","left","middle",2,1,500,-96,20,true,false,true,0,false,false);

mm_menu_1009233220_0.addMenuItem("song1","location='http://www.yoursite.com/song1.m3u'");

mm_menu_1009233220_0.addMenuItem("song2","location='http://www.yoursite.com/song2.m3u'");

mm_menu_1009233220_0.addMenuItem("song3","location='http://www.yoursite.com/song3.m3u'");

mm_menu_1009233220_0.hideOnMouseOut=true;

mm_menu_1009233220_0.menuBorder=0;

mm_menu_1009233220_0.menuLiteBgColor='#e0dfe3';

mm_menu_1009233220_0.menuBorderBgColor='#555555';

mm_menu_1009233220_0.bgColor='#ffffff';

mm_menu_1009233220_0.writeMenus();

} // mmLoadMenus()

//-->

</script>

<script language="JavaScript1.2" src="mm_menu.js"></script>

<script language="JavaScript">

<!--

function mmLoadMenus2() {

if (window.mm_menu_1010061330_0) return;

window.mm_menu_1010061330_0 = new Menu("root",78,20,"Verdana, Arial, Helvetica, sans-serif",9,"#000000","#cccccc","#cc0000","#000000","left","middle",2,1,500,-96,20,true,false,true,0,true,false);

mm_menu_1010061330_0.addMenuItem("song4","location='http://www.yoursite.com/song4.m3u'");

mm_menu_1010061330_0.hideOnMouseOut=true;

mm_menu_1010061330_0.menuBorder=0;

mm_menu_1010061330_0.menuLiteBgColor='#e0dfe3';

mm_menu_1010061330_0.menuBorderBgColor='#555555';

mm_menu_1010061330_0.bgColor='#ffffff';

mm_menu_1010061330_0.writeMenus();

} // mmLoadMenus()

//-->

</script>

<script language="JavaScript1.2" src="mm_menu2.js"></script>

</head>

<body>

<script language="JavaScript1.2">mmLoadMenus();</script>

<a href="#" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1009233220_0,0,-60,null,'audio');"><img name="audio" src="audio1.gif" width="14" height="14" border="0" alt=""></a>

<script language="JavaScript1.2">mmLoadMenus2();</script>

<a href="#" onMouseOut="MM_startTimeout2();" onMouseOver="MM_showMenu2(window.mm_menu_1009233220_0,0,-60,null,'audio');"><img name="audio" src="audio2.gif" width="14" height="14" border="0" alt=""></a>

</body>

</html>
Copy linkTweet thisAlerts:
@steelersfan88Oct 10.2004 — Do you have this online anywhere?
Copy linkTweet thisAlerts:
@sciguyryanOct 10.2004 — Well, I get an error, You need to define the Menu element, it can't be called as a new Menu unless it has been defined.



RyanJ
Copy linkTweet thisAlerts:
@JPnycOct 10.2004 — Man I hate code generators.
Copy linkTweet thisAlerts:
@sciguyryanOct 10.2004 — Yea, they mess up a lot and are hard to fix.


RyanJ
Copy linkTweet thisAlerts:
@JPnycOct 10.2004 — Whenever I try to read/debug their code I get this sharp pain behind my right eye?
Copy linkTweet thisAlerts:
@GenerationXauthorOct 10.2004 — Code generators are tne only way to go for me until I learn how to write scripts myself. So how do you define new menu? Would it help if I posetd the .js file? ? I don't have this online. Is their anywere I can post it really quick?
×

Success!

Help @GenerationX 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.15,
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,
)...