开发者

jquery explode()

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜