My AJAX Call is working fine in all browsers including IE 8,9,10,11 in my Windows 8 machine
But the same code is not working in my friend's machine who has windows 7 and IE 11 installed. Though the same code is working on his other browsers i.e. Firfox, Chrome etc.
My AJAX call is as below
str = "type=checkloginstatus";
$.ajax({
type: "POST",
dataType: "json",
url: "random.php?"+$.now(),
cache : false,
data: str
}).done(function( data ) {
console.log(data);
});
Can anyone help me please ?
Thanks in advance !
I have same problem. Windows 7 and IE 11 is a bad combination. When I run my AJAX (called ajaxB.asp from the url line in IE11 it returns data. However if I run it from within my html page it returns NOTHING!
Code:
function winkeltonen(dm)
{
$.get(
"ajax/ajaxB.asp",
{stand: dm},
function (data) {
if (data == '...') // empty
{
$('#DYNdeel2').hide();
}
else
{
document.getElementById('DYNbal').innerHTML = data;
$('#DYNdeel2').show();
}
});
}
It runs fine in opera and Firefox and all IE's before 11
Related
I have a js function
function getdata(gender,filtervals,limit) {
//alert("Hi");
$(".photo,.info").html('...Loading....');
jQuery.ajax({
type: "POST",
url: 'data.php',
data: {
filtervals : filtervals,
gender : gender, // This is where the error is mentioned
limit : limit
},
success: function(result) {
if(result){
$("#List").html(result);
$("#List").css('display','block');
}
}
});
}
I get an error in IE (Only in IE) console saying 'expected ":"' at line 169 which I have identified with by commenting that on the right side
This code works well on chrome and firefox but not on IE and some mobile browsers.
Been trying to narrow down why my entire javascript is not working on IE and some mobile browsers. After vetting my code through JsHint and other tools, I checked on IE console. And this seems to be the only problem.
Any help would be greatly appreciated as I have been breaking my head on thsi for a long time.
I want to know the time taken for the font to be downloaded while using font-face. Hence i am using the following code
$.ajax({
async: true,
type:'GET',
url: "fontPath/font.woff",
CustomData: {fontObjIndex: i}
success: function() {
console.log('font downloaded')}
});
so that i can confirm that a particular font has been downloaded in client side using font-face.
This method works well in all modern browsers except IE 9. Does $.ajax accept Font urls in IE 9?
Note: It didn't enter progress or fail functions either.
Edit : Sorry i entered the code wrongly there. The error is not in that line as it works in all other browsers and it still persists in IE9
Try this:
$.ajax({
async: true,
type:'GET',
url: 'fontPath/font.woff',
CustomData: {fontObjIndex: i}
success: function() {
console.log('font downloaded')}
});
Please apply the following code to work
$.ajax({
async: true,
type:'GET',
url: "fontPath/font.woff",
CustomData: {fontObjIndex: i},
success: function() {
console.log('font downloaded')}
});
IE has no console object when Developer tools is not open.. Try running your code by commenting your console.log and try again..
If you want to use console , you need to define that first if Developer tool's is not open..
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {};
REF : Jquery AJAX not working in IE9
I am developing an app for a company i work for but this ajax call only works on IE9+, FF, Chrome . I've been reading around without much luck.
Here is the code i have.It is pretty simple:
var request_getShoppingCart = $.ajax({
url:"classes/sCart.php?action=getItems",
cache: false,
});
request_getShoppingCart.done(function(Data) {
$('#shoppingCart').html(Data);
});
Any help is appreciated
IE fails with trailing comma.
var request_getShoppingCart = $.ajax({
url:"classes/sCart.php?action=getItems",
cache: false //remove comma here
});
request_getShoppingCart.done(function(Data) {
$('#shoppingCart').html(Data);
});
Also read
jQuery .ajax method in IE7 & IE6 not working but working fine in Firefox
Does Internet Explorer 9 choke on extra commas at the end of array and object literals?
I am trying to measure download speed with ajax call.
Here is the my code
var start = new Date();
$.ajax ({
url: 'https://www.example.com/perftest/dummyFile1024',
cache: false,
success : function() {
var total = (new Date() - start)
alert(total)
},
error : function(jqxhr, status, ex) {}
})
It doesn't wait until whole file loaded. When I add async: false, it waits for loading whole file and I am able to measure bandwidth at chrome and safari however internet explorer and firefox still works the same as async: true, they don't wait until whole file loaded. Do you have any idea how I can manage it works for I.E. and firefox as well? Thanks.
IE 8/9 cross domain requests require jQuery to use a different transport method which uses a XDomainRequest instead of the default XmlHttpRequest.
I believe the question has been answered already here: [question]: CORS with jQuery and XDomainRequest in IE8/9
For FireFox try setting the "dataType" of the content returned by the $.ajax request.
I have the following code for submitting data using ajax from forms of class ajax. this works perfectly in Firefox, Safari and Chrome but fails in IE.
ajax: function() {
$('form.ajax').live('submit', function() {
var form_ajax = $(this);
$.ajax({
url: form_ajax.attr('action'),
data: form_ajax.serialize(),
type: form_ajax.attr('method'),
dataType: 'script',
beforeSend: function(xhr) {
$('#ajax-bid-new .ajax-form-error, #ajax-bid-new .ajax-form-success').remove();
form_ajax.slideUp();
}
});
return false;
});
Please help - I am stuck here for past 2 days. I am returning a Javascript file from server to be evaluated inside browser. This works as expected in Firefox, Chrome and Safari, but IE receives it as a file and opens up the file download dialog.
What can I do in IE to make this work? I tried by dropping the following code in my application.js file (I'm doing a rails project btw)
// public/javascripts/application.js
jQuery.ajaxSetup({
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
})
I get the same behavior from IE even after writing the ajaxSetup block like above.
Looks like live doesn't work with submit in IE. Have you tried using a normal submit instead:
$('form.ajax').submit(function() {
To catch live form submit events in IE, instead of:
$("form").live("submit", function() { ... });
to
var submitHandler = function() { ... };
$("body").children().each(function() {
$("form", this).live("submit", submitHandler);
})
Point to be noted
IE caches AJAX requests really aggressively (more so than Firefox, anyway). You need to set the Cache-Control headers in the response appropriately if this is not right for your site.
change your content type, last time i fixed similar problem by changing content-type from application/json; charset=utf8 to just plain application/json
jQueries' bind and live behaviours along with the liveQuery plugin
LiveQuery plugin solved the problem http://github.com/brandonaaron/livequery