0

我正在寻找一种在 jquery 中使用变量的方法。

我正在从超链接中获取 src 属性。

但是我想将它附加到 jw 播放器的 hyerlink 中。

 '640','467','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','I need the href attribute to go in here');
so.write('mediaspace');

我的问题是他们没有 div 附加它,我不能在这个空间中放置任何东西来附加它,因为它只需要是超链接。

<a class="video_click" href="video/link.flv" rel="prettyPhoto" title="Flash 10 demo"><?php echo "$fname"; ?></a>

<script type="text/javascript">

$('a.video_click').click(function(event){
event.preventDefault();

var test = $(this).attr('href');
alert(test);

}); 

所以我抓住了href他们是他们追加说什么的方式{$name}吗?

4

1 回答 1

0

是 jQuery.data() 你在找什么?

http://api.jquery.com/jQuery.data/

它允许您使用元素存储任意数据并在以后访问它。

于 2011-01-20T16:43:51.337 回答