Turning a datatable into an array with jquery

Asked

Viewed 122 times

4

I have as output a string with the following format.

[["link"],["<iframe id='player' type='text/html' width='452' height='272' src='http://www2.camara.leg.br/camaranoticias/tv/embedAoVivo.html?width=450&height=253'  frameborder='0'></iframe>"]]

It represents a datatable. I want to access the second element. If possible as an array in jquery. Someone could give a hint?

1 answer

2

Jquery é Javascript, so you can access normally via []

var x = [["link"],["<iframe id='player' type='text/html' width='452' height='272' src='http://www2.camara.leg.br/camaranoticias/tv/embedAoVivo.html?width=450&height=253'  frameborder='0'></iframe>"]];

alert(x[0]);
alert(x[1]);

http://jsfiddle.net/m8zzgrr5/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.