Jquery .Find() Doesn't Return Data in Ie But Does in Firefox and Chrome

jQuery .find() doesn't return data in IE but does in Firefox and Chrome

Check the content type of the response. If you get messages.xml as the wrong mime type, Internet Explorer won't parse it as XML.

To check the content type, you need access to the XMLHttpRequest object. The normal success callback doesn't pass it as a parameter, so you need to add a generic ajaxComplete or ajaxSuccess event handler. The second parameter for those events is the XMLHttpRequest object. You can call the getResponseHeader method on it to get the content type.

$(document).ajaxComplete(function(e, x) {
alert(x.getResponseHeader("Content-Type"));
});

Unfortunately there's no way that I know of in Internet Explorer to override what the server sends, so if it's wrong you need to change the server to send "text/xml" for the content type.

Some browsers have a overrideMimeType method that you can call before send to force it to use "text/xml", but Internet Explorer doesn't support that as far as I know.

Jquery.find() returns null in ie, but not in other browsers

testElement is already a jQuery object so you don't have to wrap it in $(). Try this

var testElement=$('.echItm').find('h4');
alert(testElement.html());

JQuery not returning div in IE, but Firefox/Chrome/Safari is?

change the name of the variable or define it using the var-keyword. parent is a built-in property of window .

JQuery .find() and .children() are not working in IE11

I have found one solution for the above question of mine.

$(document).ready(function() {
var optarray = $("#CurrencyPair").children('option').map(function() {
return {
"value": this.value,
"option": "<option value='" + this.value + "'>" + this.text + " `enter code here`</option>"
}
})

$("#part1currency").change(function() {
$("#CurrencyPair").children('option').remove();
var addoptarr = [];
addoptarr.push(optarray[0].option);
for (i = 1; i < optarray.length; i++) {
if (optarray[i].value.substring(0, 3).indexOf($(this).val()) > -1) {
addoptarr.push(optarray[i].option);
}

}
$("#CurrencyPair").html(addoptarr.join(''))
}).change();
})

JQuery Code works in chrome and IE but it not works in firefox

i use keyup event for text input that it doesn't work in firefox
so i change it to keypress and my problem be solved.
I can give more details if necessary.

jQuery doesn't work on Firefox but works on Chrome

You do not define event so that is your problem. Get away from using inline event handlers and bind it with jQuery.

$("[data-action]").on("click", function (event) {  event.preventDefault();  var btn = $(this);  var action = btn.data("action");  console.log(action);});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><button class="grey-btn" data-action='delete'>Delete</button><button class="grey-btn" data-action='update'>Update</button>


Related Topics



Leave a reply



Submit