Abhijeet Panpatil

Abhijeet Panpatil

  • NA
  • 95
  • 19.2k

json responce into a varibale

Mar 22 2018 11:12 AM
my api gives me the json like following:-
 
{
   "url": "https://moviestarstorage.blob.core.windows.net/water/abhijeet.mp4" 
}

for this output i wrote the following code:-
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>     
<div id="dropdown">    
     <span class="list">    
         <select id="itemList">
             <option value="select">Select</option>    
         @foreach (var item in Model)  
           {    
             <option value="@item">@item</option>     
        }    
         </select>  
                       
</span>  
        <span class="button">   
          <button type="button" id="btn">Watermark</button> 
            <script type="text/javascript">
                 $(function () {                   
  $("#btn").bind("click", function () {        
                  var url = "http://104.211.243.204/?container=comedy-movies&blob=" + encodeURIComponent($("#itemList").val());          
               window.location.href = url;
                                    });
                  });
             </script>     
         </span > 
    </div >  
 this gives me output in json format as mentioned above.
Now i want to store the url value i.e  
"url": "https://moviestarstorage.blob.core.windows.net/water/abhijeet.mp4"  into a variable .How can it will done??

Please help me regarding this


Answers (1)