如何在jsFiddle中使用ajax请求 [英] how to use ajax request in jsFiddle

查看:112
本文介绍了如何在jsFiddle中使用ajax请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建我的第一个小提琴。所以这里是我想用jquery做的

I'm trying to create my first fiddle. So here's what I want to do with jquery

$('.list').live('click', function(){
    var dataPass = 'uid='+ uid;
    $.ajax({
        type: "POST",
        url: "test.php",
        data: dataPass,
        cache: false,
        success: function(html){
            //Do something
        }
    });
});

那么如何/在哪里写 test.php 文件?

So how/where do I write the codes for test.php file? It's going to return some html markup.

推荐答案

不可能向当前域以外的域发出AJAX请求,

It's not possible to make an AJAX request to a domain other than the current one, as it's a pretty basic security risk.

jsFiddle有一个 API 用于测试您应该使用的AJAX请求。

jsFiddle have an API for testing AJAX requests which you should use instead.

这篇关于如何在jsFiddle中使用ajax请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆