How to iterate through a list of strings returned from a web service using JQuery

后端 未结 4 1793
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-19 17:29

This is my first JQuery experience and I\'m on quite a tight deadline. It\'s a bit of an embarrassing question, but here goes. I\'m calling a web service that returns a l

4条回答
  •  情歌与酒
    2020-12-19 17:43

    Using Array.split() will produce an array:

    var string = "red,blue,green,orange"
    
    $.each(string.split(','), function(){
      alert(this)
    })
    

提交回复
热议问题