What I'm trying to achieve is to output a json list containing a list of Css classes and their corresponding URL entries, i.e.
var jsonList = [{"CSSClass":"testclass1","VideoUrl":"/Movies/movie.flv"},{"CSSClass":"testclass2","VideoUrl":"/Movies/movie2.flx"}];
The foreach element in the list. I am adding a click event to the class ...
$.each(script, function() {
$("." + this.CSSClass, "#pageContainer").live('click', function(e) {
videoPlayer.playMovie(this);
return false;
});
});
I am wondering if I can somehow get the corresponding url from jsonlist, without having to repeat all of them, look for CSSClass or add link url as attribute?
source
share