/* * */ $("#pSearch").click(function () { console.log("search..start") paginazione.paginaCorrente = 1 if (userData && (userData.idUser == "18")) { //mio utente bypassa controlli } else { if ($("#source").val() == 0) { alert("Invalid language provided!") $("#source").focus() return false } if ($("#target").val() == 0) { alert("Invalid language provided!") $("#target").focus() return false } } var dati = { source: $("#source").val(), target: $("#target").val(), accountType: $("#accountType").val() } $.ajax({ url: 'tableResult.php', method: 'POST', data: dati, success: function (r, s, x) { $("#divResult").html(r) }, error: function (h, s, x) { console.log(h) console.log("error: " + h.statusText) } }) }) $("#pChangeLanguagePair").click(function () { var source = $("#source").val() var target = $("#target").val() $("#source").val(target) $("#target").val(source) }) $("#pAdvancedSearch").click(function () { document.location = '/advanced-translator-directory/' }) /* guardo se ci sono parametri hash*/ var source = document.location.hash.match(/source-([^&]*)/) if (source) { source = source[1] } if (source != "") { $("#source").val(unescape(source)) console.log("setto source", source) } var target = document.location.hash.match(/target-([^&]*)/) if (target) { target = target[1] } if (target != "") { $("#target").val(unescape(target)) console.log("setto target", target) } var accountType = document.location.hash.match(/accountType-([^&]*)/) if (accountType) { accountType = accountType[1] } if (accountType != "") { $("#accountType").val(unescape(accountType)) console.log("setto account type", accountType ) } if (source && target) { console.log("autosearch..start", source , target, accountType) $("#pSearch").click() }