function tinyurl(){
jQuery.ajax({
url:'http://tinyurl.com/api-create.php?url=http://xxxxxxxxxxx/',
dataType:'script',
success:function(response){
var tiny = response.id;
}
});
}
function wal(){
jQuery.ajax({
url:'Http://xxxxx.xx/xxx' + tiny +',
dataType:'jsonp',
success:function(data){
}
});
}
请帮助我,我想在frnd函数中使用那个小网址
我没有取得任何成功请帮助我。
我想在wal函数中使用该response.id。
答案 0 :(得分:0)
两个步骤:
编辑wal()
函数以获取参数:
function wal(tiny) {
在tinyurl
的成功函数中,调用wal()
,将响应ID传递给它:
function tinyurl() {
jQuery.ajax({
url: 'http://tinyurl.com/api-create.php?url=http://xxxxxxxxxxx/',
dataType: 'script',
success: function (response) {
wal(response.id);
}
});
}