Click to See Complete Forum and Search --> : can someone make a script for me?


cmleadguitar
08-08-2003, 05:17 PM
I am a newbie with javescript, but i realla would like to have one that ok say im playing one song on my website, but i want to change to another one, could i like make a buttom that says "like this song better?" and when they click it, it changes just the song and the page stays loaded???

thanks for all of your help

-Wayne

Zero-x252
08-09-2003, 04:37 AM
I can help you along with it but I am kinda new too...I will start working immediately

Do you want a playlist or do you want a link that changes every time the song siwtches
Do you want to be able to go back?
Does your host allow PHP?

sciguyryan
08-09-2003, 05:33 AM
hi,

just how many songs would you like the button be able to play? if you intend ysing more than two i would reccomend ysing a dropdown menu instead.


if you need a dropdown menu i could make one but, i would need the location(s) of your song(s) though.

if you wish me to supply a dropdown menu E-mail me at R.jones194@fsmail.net

xataku_nakusute
08-09-2003, 06:15 AM
i have a similar item on my clients website...
however, i based it all in javascript and another thumbs down for this item and the html-based one is the fact that a) it slows down load times, and b) the song will automatically stop when a new page is loaded...
however, this is the page its on: http://www.todaysendmusic.com/main.html
it is located in the top-most frame and off to the right.
of course, in the near future when my client finally decides its time to put his actual music up, ill change the song sources and names.
i shall post the code in the next message for it is somewhat long...

xataku_nakusute
08-09-2003, 06:18 AM
just a head-note for ya. this is the primary reazn why i based the site with frames(so the jukebox will play without any breaks or pauses when you browse the site.)

<script type="text/javascript">
function play(){
song = document.f1.slist.value;
track.src=song
}

function stop(){
track.src=""
}
</script>
<form name="f1">
<select name="slist">
<option value="../song04.wav">Song 1</option>
<option value="../song06.wav">Song 2</option>
</select>
<br>
<input type="button" onclick="play()" value="Play">
<input type="button" onclick="stop()" value="Stop">
</form>
<bgsound id="track" src="">

thats the basic coding for it.

if you wanted to make it so users can browse and still listen, you can do one of two things:
1) base your site with frames and add the above coding in a static(non-changing) frame.
OR
2)create a link on your site thatll open up a new window. make the new window contain the coding, and warn the users not to minimize the window, but to simply set focus on the main window.

dem:

index.html-

<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function jukebox()
{
window.open("jukebox.html","JukeBox","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=105, height=1");
}
</SCRIPT>
</HEAD>
<BODY>
<A href="?listen" onclick="jukebox()" onfocus="jukebox()" accesskey="j">JukeBox</A>
</BODY>
</HTML>

and then make "jukebox.html" contain the jukebox code i provided earlier.
NOTE: all of the items after the 'window.open("' part are editable.

ALSO: the link(<A>) part contains the syntax: accesskey=
this is like a 'hotkey' thatll automatically launch the link if-
ALT+j are pressed. you may change this letter to any alpha-numeric value you want(in order for it to launch automatically, you must keep the 'onfocus="jukebox()"' part. if not, then the user will have to press ALT+j+ENTER instead.).

i hope this helps!
http://wi3k.com/xnoxios/index.php