最佳答案
如何使用jQuery为<span>
标签设置值…
例如……
下面是我的<span>
标签:
<span id="submittername"></span>
在我的jQuery代码:
jQuery.noConflict();
jQuery(document).ready(function($){
var invitee = $.ajax({
type: "GET",
url: "http://localhost/FormBuilder/index.php/reports/getInvitee/<?=$submitterid;?>",
async: false
}).responseText;
var invitee_email=eval('(' + invitee + ')');
var submitter_name=$.map(invitee_email.invites, function(j){
return j.submitter;
});
alert(submitter_name); // alerts correctly
$("#submittername").text(submitter_name); //but here it is not working WHy so??????
});