Lord Relix Lord Relix - 1 year ago 101
Javascript Question

jQuery code working in FF, Chrome, not in IE

I have a small snippet of code, this:

$(document).ready(function () {
$("#check").blur(function () {
var member = check.value;
$.getJSON('/Endpoint/MemberName/' + member, function (result) {
// var data = JSON.parse(result);
var json = result;
if (json.result.length != 0) {
$("div#preload h2").html("Nombre: " + json.result[0].fullName);
else {
$("div#preload h2").html("No encontrado!");


In Firefox and Chrome the snippet is working as intended, yet in IE browsers I get the following error:

SCRIPT5009: 'check' is undefined

Any idea on what could help me solve this issue?

EDIT: Added check textbox field:

<div class="input-group col-md-12">
<input type="text" class="form-control input-lg" placeholder="Buscar numero de socio" id="check" name="check" />
<span class="input-group-btn">
<button class="btn btn-info btn-lg" type="button">
<i class="glyphicon glyphicon-search"></i>
<button class="btn btn-primary btn-lg" type="button" data-toggle="modal" data-target="#myModal">
<i class="glyphicon glyphicon-plus"></i> AƱadir Cliente sin Cuenta

Ro. Ro.
Answer Source
var member = this.value;
var member = $(this).val();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download