0
加載JSON數據,並將電話號碼,工作正常,但調用外部函數的數量JSON克隆數據爲字符
的數據截斷部分以下JSON代碼:
$.ajax({
url: url,
type: "GET",
data: {No: val },
dataType: "json",
cache: false,
error: function() {
alert('error');
} ,
onFailure: function() {
alert('Fail');
} ,
success: function(result) {
$.each(result.sites,function(index,dat){
var site_phone='<a href="#" onClick="dialto('+dat.telephone+')"><img src="phone.png" alt="dial" /></a>'
$("#phone").append(
'<div style=" height:50px;width:400px;direction:ltr;">'+
site_phone+
'<h2>'+dat.telephone+'</h2>'+
'</div>'
);
});
}
})
function dialto(telephone)
{
alert(telephone);
window.open('tel:'+telephone+'', '_system');
}
dat.telephone提供恰當的號碼077-123456 提醒(電話)介紹-123456
有什麼想法嗎?
字符串不是引用發送numper作爲一個整體。我希望它顯示'-123393',因爲這是77 - 123456. – 2014-10-27 17:24:30