javascript - Use variable in new variable -


i'm trying add variable within new variable.

my first variable is:

var video5 = myobj.find('hosted-video-url').text(); (this returns direct link mp4-file)

my second 1 should like:

var playvid5 = "playvideo('"video5"')";

variable playvid5 should result "playvideo('http://link.to/video.mp4)')"

when try make variable playvid5 in way showed above, whole code stops working , nothing displayed. when use var playvid5 = "playvideo('"+video5+"')";, output "playvideo('')", that's not need either.

i'm trying place 2nd variable in piece: ('<a href="#" onclick="'+playvid5+'">bekijk video</a>')

in way can place first variable in second one?

try replace video5 string value.

var video5 = myobj.find('hosted-video-url').text(); var playvid5 = "playvideo('video5')"; playvid5 = playvid5.replace("video5", video5); 

Comments

  1. The King Casino | Ventureberg
    Discover the rise and fall ventureberg.com/ of the https://jancasino.com/review/merit-casino/ king casino, one of https://septcasino.com/review/merit-casino/ the world's largest The Casino is operated by the King titanium flat iron Casino poormansguidetocasinogambling.com Group. You can

    ReplyDelete

Post a Comment

Popular posts from this blog

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

c# - Getting per connection bandwidth statistics -

jquery - ajax and php updating mysql -