jquery function file only working in Firefox!
Hi all,
I'm quite new to Jquery so please go easy.
I've created a function file that does a few functions on a site i'm developing, mainly clearing search boxes and retrievining data with ajax etc.
Everything is working great on Firefox, but on Chrome and I.E absolutely none of it works. I expect I may be missing something trivial but can't figure it out! Code is below:
-
$(function() {
$(document).ready(function() {
$('#displayinvoices').change();
});
$("#clearinvoicesearch").on('click', function() {
$("#isearch").val("");
$('#displayinvoices').change();
});
$("#displayinvoices").on('change', function () {
$.ajax({
type: "GET",
url: "dataretriever.php?nr=" + $(this).val(),
dataType: "html",
success: function(response){
$("#responsecontainer").html(response);
}
});
});
$('#isearch').keypress(function (e) {
var key = e.which;
if(key == 13) // the enter key code
{
$('#invoicesearch').click();
}
});
$("#invoicesearch").on('click', function () {
$.ajax({
type: "GET",
url: "dataretriever.php?search=" + $('#isearch').val() + "&searchby=" + $('#searchby').val() ,
dataType: "html",
success: function(response){
$("#responsecontainer").html(response);
}
});
});
Any help is much appreciated!
Cheers
Ed