How to make string as an Array Object in JQuery
<p>I have got below string values in a variable.</p>

<pre><code>var mystring = '{"img_src":"/english/images/spa.jpg",
    "img_title":"Enjoy a refreshing shower at 43,000 feet",
    "img_alt":"Enjoy a refreshing shower at 43,000 feet",
    "img_height":"326",
    "img_width":"980",
    "header":"Enjoy a refreshing shower at 43,000 feet",
    "subheader":"One of many groundbreaking amenities",
    "bg_color":"",
    "url_href":"1"}, 
     {"img_src":"/english/images/spa1.jpg",
    "img_title":"Enjoy a refreshing shower at 43,000 feet",
    "img_alt":"Enjoy a refreshing shower at 43,000 feet",
    "img_height":"326",
    "img_width":"980",
    "header":"Enjoy a refreshing shower at 43,000 feet",
    "subheader":"One of many groundbreaking amenities",
    "bg_color":"",
    "url_href":"1"}'
</code></pre>

<p>Now I want to convert this string variable into Array object. So that If I try to access it my function it should behave like an array object. For example.</p>

<p><code>some code to Convert(mystring) to an Array Object(myArryObject)</code>, then I want to pass it to my function like below</p>

<pre><code>$.fn.liveBanner = function(myArryObject,optional_options) 
    { 
      //here I want to access my myArryObject as below
      alert(myArryObject[0].img_src) //then it should give "/english/images/spa.jpg"
});
</code></pre>

<p>Please suggest using JQuery.</p>

<p><strong>EDIT:</strong></p>

<p>I did the changes as suggested by @Deceze, please see below:</p>

<pre><code>             var myString = "'"+ $("#RotationImages #mainHidden").attr("value")+"'";     

    var myArrayobj = jQuery.parseJSON('[' + myString + ']');
    alert(myArrayobj.img_src);
</code></pre>

<p>the above code is giving below error</p>

<pre><code>Error: uncaught exception: Invalid JSON:'{"img_src":"/english/images/spa.jpg", "img_title":"Enjoy a refreshing shower at 43,000 feet","img_alt":"Enjoy a refreshing shower at 43,000 feet", "img_height":"326","img_width":"980","header":"Enjoy a refreshing shower at 43,000 feet","subheader":"One of many groundbreaking amenities on the Flight","bg_color":"","url_href":"1"}'
</code></pre>
