ajax048472,jquery $.ajax dilemna - revision required

Update

I just tested the link to my example and... damn thing works.! I am not convinced??? Any comments still welcome.

I have just updated my browsers and Chrome rejects my (previously working) ajax call to a simple text file containing html. Here is my current bare-bones code:

var stringData = $.ajax({ url: 'digz/index/'+$(this).attr("id")+'.txt', async: false }).responseText;

var $newItems = $(stringData);

alert($newItems.filter('.element').length); // FF & IE OK but Chrome = '0'

// there are few things here and I have tested with them rem'd out

$('#container').isotope( 'insert', $newItems ); // std. isotope form

The Chrome console gives me:

Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.

XMLHttpRequest cannot load [...file path/name... ] Origin null is not allowed by Access-Control-Allow-Origin.

And the pointer in jquery - around line 8472 in ver 1.9.0

// Do send the request

// This may raise an exception which is actually

// handled in jQuery.ajax (so no try/catch here)

xhr.send( ( s.hasContent && s.data ) || null );

I have a stripped down version of my project here:

Null return on Ajax

I figure the ajax line is the problem and needs revision. I have tried a lot of alternate permutations but there so many options and my experience here is limited.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值