Shoutcast | Jquery |传递变量

Shoutcast | Jquery |传递变量,jquery,shoutcast,Jquery,Shoutcast,我正在使用shoutcast库从我的服务器检索流信息,包括当前播放的歌曲、最近播放的10首歌曲等。。一切正常 jQuery用于提取当前播放歌曲的代码如下 我需要能够从jQuery向上面的'str='传递一个变量。如果我说str=HELLO,LED将滚动显示HELLO。我希望LED滚动当前播放的歌曲,可以从jQuery中检索。。我想要像str=variable这样的东西,因为歌曲总是不同的 希望这不会让人困惑,谢谢 请注意,首先为您的客户提供一个id: <embed id='myEmbedd

我正在使用shoutcast库从我的服务器检索流信息,包括当前播放的歌曲、最近播放的10首歌曲等。。一切正常

jQuery用于提取当前播放歌曲的代码如下 我需要能够从jQuery向上面的'str='传递一个变量。如果我说str=HELLO,LED将滚动显示HELLO。我希望LED滚动当前播放的歌曲,可以从jQuery中检索。。我想要像str=variable这样的东西,因为歌曲总是不同的

希望这不会让人困惑,谢谢


请注意,

首先为您的客户提供一个id:

<embed id='myEmbeddedObj' ... >
在您引用的上述脚本中,替换为:

$("#myEmbeddedObj")[0].prop("baseURL") = "http://www.satisfaction.com/led-scroller-generator/&clickURL=http://www.satisfaction.com/led-scroller-generator/&clickLABEL=LED Scroller Generator&flashLABEL=Satisfaction.com&delaySpeed=10&transID=0&str=(" + this.get('songtitle') + ")&bgColor=0&symbolX=9&w=3&h=3&pointType=point&glowColor=16711680&designNum=1";

您需要对在查询字符串中传递的URL进行URL编码,然后对整个内容进行编码,以便在HTML中使用。从您的代码片段中,我不清楚URL是什么,以及需要编码什么才能插入到哪里。
&str=(+ $track +)&bgColor=0&symbolX=9&w=3&h=3&pointType=point&glowColor=16711680&designNum=1"
<embed id='myEmbeddedObj' ... >
$('#songtitle').text(this.get('songtitle'));
$("#myEmbeddedObj")[0].prop("baseURL") = "http://www.satisfaction.com/led-scroller-generator/&clickURL=http://www.satisfaction.com/led-scroller-generator/&clickLABEL=LED Scroller Generator&flashLABEL=Satisfaction.com&delaySpeed=10&transID=0&str=(" + this.get('songtitle') + ")&bgColor=0&symbolX=9&w=3&h=3&pointType=point&glowColor=16711680&designNum=1";