fiddle解决ajax,AJAX in jsFiddle

I solved this by creating a Fiddle in jsFiddle just for testing Ajax loads. It’s some very simple HTML with an image and some copy — you can see it here:

best-of-no-150px.png

This post will help you get to know the iOS SDK a little better. It leads you through some choreographed steps of iOS app development, even if you have little or no programming knowledge. It covers some key principles and applies these directly to something useful and relevant: the creation of a simple but functioning portfolio app for the iPhone.

body {

font-family: Arial;

color: #333333;

line-height: 1.4em;

}

img {

margin: 0 0 1em 1em;

padding: 1em;

background: #ffffff;

border: 1px solid #eaeaea;

display: inline-block;

float: right;

-moz-border-radius: 8px;

-webkit-border-radius: 8px;

border-radius: 8px;

}

.container {

background: #fafafa;

padding: 1em;

}

Demo on JS Fiddle.

If you use Firebug to click on the “result” frame, you can get the source URL of the iframe. When you copy this source URL into the Fiddle containing your Ajax request, it will work because now it is on the same domain. Here’s a demonstration:

basic load

body {

font-family: Arial;

}

.excontainer {

padding: 1em;

}

label {

display: block;

width: 100%;

}

p {

padding: .5em;

}

a, a:visited {

color: #2d9afd;

}

.changed {

color: #ff0099;

}

.highlight {

background: #faffda;

}

.entered {

color: #f5560a;

}

.green {

color: #7fbf38;

}

.hellomouse, .clickable, #foo, #event {

cursor: pointer;

}

button {

margin-bottom: 1em;

}

div {

margin: 1em 0;

}

#foo {

display: inline-block;

}

ul {

margin: 1em 0;

}

.form, form, .stuff, .morestuff, stuff3 {

margin: 1em 0;

padding: 1em;

background: #ececec;

}

input {

font-size: 1.1em;

padding: 2px;

}

.placeholder {

color: #ff0099;

font-weight: normal;

}

::-webkit-input-placeholder {

color: #cccccc;

}

:-moz-placeholder {

color: #cccccc;

}

:-ms-input-placeholder {

color: #cccccc;

}

:focus::-webkit-input-placeholder {

color:transparent;

}

.content {

margin-top: 5px;

padding: 1em;

background: #eeeeee;

}

// learn jquery ajax

// http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/

// no need to specify document ready

$(function(){

// don't cache ajax or content won't be fresh

$.ajaxSetup ({

cache: false

});

var ajax_load = "loading...";

// load() functions

var loadUrl = "http://fiddle.jshell.net/deborah/pkmvD/show/";

$("#loadbasic").click(function(){

$("#result").html(ajax_load).load(loadUrl);

});

// end

});

Demo on JS Fiddle.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值