NightDev Community Forums

Send parameter to json


#1

I have code like this:

$(eval var a=encodeURIComponent($(urlfetch json http://ac1011.hopto.org:4095/data/songlist.json?search=$(1))),r=a.songlist,s=r.length,b=[],e="lid",f="sid";{for(i=0;i<20;i++){b.push(r[i].song_id);b}})

now i need encode the $(1) and send it
but doesn’t work


Output $(querystring $(1)) with %20
#2

@932_frc

$(eval a=$(urlfetch json http://ac1011.hopto.org:4095/data/songlist.json?search=$(querystring));b=[];for(i=0;i<a.songlist.length-1;i++){b.push(a.songlist[i].song_id);}b.length>0?b.join(`, `).slice(0,400):`Error!`)