如何在jsFiddle中使用ajax请求

编程入门 行业动态 更新时间:2024-10-28 04:29:00
本文介绍了如何在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请求

本文发布于:2023-11-23 09:26:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620934.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   jsFiddle   ajax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!