Hi all .I wonder how to remove the last ',' from end of playlistfromdbtotextfile.php?songid=,2,3,4,5,10,11,15,19,18,20,
The script below where it is bold creates this link for me and my php function does not work with ',' at start or end of the passed url . Could any one help me remove the last ',' but keep it it else where since between passeed variable.Thanks
The script below where it is bold creates this link for me and my php function does not work with ',' at start or end of the passed url . Could any one help me remove the last ',' but keep it it else where since between passeed variable.Thanks
Code:
<script language="javascript">
<!-- hide
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "Uncheck All"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "Check All"; }
}
function newWindow(url) {
var x,y;
x = screen.width-35;
y = screen.height-30;
var win = window.open(url,'glossaryWindow','toolbar=no,directories=no,width=500,height=500'+
'screenX=0,screenY=0,top=0,left=0,location=no,status=no,scrollbars=no,resize=yes,menubar=no');
}
// Start of Playme Function
function playme()
{
Id = document.forms.mp3Play.Id;
tempUrl ='';
url = '';
if (Id.length > 0){
for (i=0; i<Id.length; ++ i)
{
if (Id[i].checked)
{
[B]tempUrl =tempUrl + Id[i].value +","[/B]
if (i == 30)
{
alert("Each time you can only select 30 songs to play")
return false;
}
}
}
}
else
{
alert("it is less than 0#2")
tempUrl = tempUrl + "&Id=" + Id.value
}
//alert(tempUrl);
url = "./playlistfromdbtotextfile.php?songid=" + tempUrl;
newWindow(url);
return false;
}
// End of Playme Function
// -->
</script>