开发者

jquery explode()

开发者 https://www.devze.com 2022-12-14 05:18 出处:网络
i开发者_Python百科 want make function like that function(data){ } i want this data as this url,email,comments

i开发者_Python百科 want make function like that

function(data){

}

i want this data as this url,email,comments

function($data){
foreach(explode(",",data) as $value)
var value = $("#value").val();
}

This code is like php. I am sure its not work but I want make this by jQuery. I made it by php


You can use

jQuery.each

to iterate through the object


function(data) {
    var i, values = data.split(",");
    for (i = 0; i < values.length; i++) {
        var value = $("#" + values[i]).val();
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消