OK your code works great, but when i tried to reuse it to do my replace function (1.empty playlist, 2. enqueue dir, 3.play 1st song of the playlist) it doesn't work ...
As you have already noticed i am not a coder, especially in javascript ...
here's what i tried to do :
<script language="JavaScript" type="text/javascript">
<!--
function getXMLHTTP()
{
try {return new ActiveXObject("Msxml2.XMLHTTP");}
catch(e) {try {return new ActiveXObject("Microsoft.XMLHTTP");}
catch(e) {}}
if(typeof XMLHttpRequest != "undefined") {return new XMLHttpRequest();}
return null;
}
function EmptyPlaylist()
{
httpRequestStatus = getXMLHTTP();
try {
httpRequestStatus.open("GET", '/?cmd=EmptyPlaylist¶m3=NoResponse', true);
httpRequestStatus.send(null);
}
catch(e) { }
}
function ReplacePlaylist()
{
httpRequestStatus = getXMLHTTP();
try {
httpRequestStatus.open("GET", '/?cmd=EmptyPlaylist¶m3=NoResponse', true);
httpRequestStatus.open("GET", '/?cmd=Browse&param1=[PATH]&param2=EnqueueDir', true);
httpRequestStatus.send(null);
}
catch(e) { }
}
//--></script>
Replace: [ <a title="replace current directory files only" href="java script:ReplacePlaylist()">Dir</a>]
guess what, it doesn't work.
Your help would be welcome
ps : As it didn't work I didn't try to have 3. working
by the way here's what my template looks like :