URL EM AJAX
Tem alguma mensagem de erro no console?
tem esses
Uncaught TypeError: $(...).iCheck is not a function
at HTMLDocument.<anonymous> (custom.js:159)
at fire (jquery-1.10.2.js:3062)
at Object.fireWith [as resolveWith] (jquery-1.10.2.js:3174)
at Function.ready (jquery-1.10.2.js:447)
at HTMLDocument.completed (jquery-1.10.2.js:118)
fontawesome-webfont.woff2 Failed to load resource: the server responded with a status of 404 (Not Found)
VM69:1 Uncaught ReferenceError: browser is not defined
at eval (eval at <anonymous> (chrome-extension://bbjllphbppobebmjpjcijfbakobcheof/src/content.js:1), <anonymous>:1:2162)
at chrome-extension://bbjllphbppobebmjpjcijfbakobcheof/src/content.js:1
VM77:61 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user[ô]s experience. For more help, check https://xhr.spec.whatwg.org/.
rapport_nikko_send_focus_event @ VM77:61
rapport_nikko_on_focus @ VM77:72
jquery.validate.js:759 Uncaught TypeError: Cannot read property [ô]call[ô] of undefined. Exception occurred when checking element usu_cpf, check the [ô]__dummy__[ô] method.
at $.validator.check (jquery.validate.js:759)
at $.validator.element (jquery.validate.js:484)
at $.validator.onfocusout (jquery.validate.js:289)
at HTMLInputElement.delegate (jquery.validate.js:411)
at HTMLFormElement.dispatch (jquery-1.10.2.js:5109)
at HTMLFormElement.elemData.handle (jquery-1.10.2.js:4780)
at Object.trigger (jquery-1.10.2.js:5021)
at Object.simulate (jquery-1.10.2.js:5344)
at HTMLDocument.handler (jquery-1.10.2.js:5595)
Uncaught TypeError: $(...).iCheck is not a function
at HTMLDocument.<anonymous> (custom.js:159)
at fire (jquery-1.10.2.js:3062)
at Object.fireWith [as resolveWith] (jquery-1.10.2.js:3174)
at Function.ready (jquery-1.10.2.js:447)
at HTMLDocument.completed (jquery-1.10.2.js:118)
fontawesome-webfont.woff2 Failed to load resource: the server responded with a status of 404 (Not Found)
VM69:1 Uncaught ReferenceError: browser is not defined
at eval (eval at <anonymous> (chrome-extension://bbjllphbppobebmjpjcijfbakobcheof/src/content.js:1), <anonymous>:1:2162)
at chrome-extension://bbjllphbppobebmjpjcijfbakobcheof/src/content.js:1
VM77:61 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user[ô]s experience. For more help, check https://xhr.spec.whatwg.org/.
rapport_nikko_send_focus_event @ VM77:61
rapport_nikko_on_focus @ VM77:72
jquery.validate.js:759 Uncaught TypeError: Cannot read property [ô]call[ô] of undefined. Exception occurred when checking element usu_cpf, check the [ô]__dummy__[ô] method.
at $.validator.check (jquery.validate.js:759)
at $.validator.element (jquery.validate.js:484)
at $.validator.onfocusout (jquery.validate.js:289)
at HTMLInputElement.delegate (jquery.validate.js:411)
at HTMLFormElement.dispatch (jquery-1.10.2.js:5109)
at HTMLFormElement.elemData.handle (jquery-1.10.2.js:4780)
at Object.trigger (jquery-1.10.2.js:5021)
at Object.simulate (jquery-1.10.2.js:5344)
at HTMLDocument.handler (jquery-1.10.2.js:5595)
Já tentou usar uma versão do JQuery com menos de 10 anos? Estamos na versão 3.2, se não me engano.
Atualizei mais continua do mesmo jeito, não tem como saber se no ajax ele entrou no success ou failure ?
Experimente:
var url = [ô]/estudante/[ô] + tipousu + [ô]/[ô] + mat + [ô]/[ô] + categoria;
$.ajax({
type: [Ô]GET[Ô],
url: url,
dataType: [Ô]json[Ô],
contentType: [Ô]application/json; charset=utf-8[Ô],
success: function (data) {
console.log(data);
$([Ô]#usuario[Ô]).html(data);
},
failure: function (errMsg) {
console.log(errMsg)
alert(errMsg);
}
});
Não mostrou nada.
Acho que encontrei algo fiz essa alteração e agora está mostrando um alert [Ô]not found[Ô]
var url = [ô]@Url.Action([Ô]Get[Ô], [Ô]Estudante[Ô])[ô];
$.ajax({
type: [Ô]GET[Ô],
url: url,
dataType: [Ô]json[Ô],
contentType: [Ô]application/json; charset=utf-8[Ô],
data: JSON.stringify({ tipo: tipousu, matricula: mat, categoria: categoria }),
success: function (data) {
console.log(data);
$([Ô]#usuario[Ô]).html(data);
},
error: function (jqXHR, textStatus, errorThrown) {
alert(errorThrown);
alert(errMsg);
}
});
Meu API controller está assim :
[HttpGet]
[Route([Ô]{categoria:int}/{matricula}/{tipo:int}[Ô])]
[ActionName([Ô]Get[Ô])]
[ResponseType(typeof(Estudante))]
public async Task<IHttpActionResult> GetByData(int categoria,string matricula,int tipo)
var url = [ô]@Url.Action([Ô]Get[Ô], [Ô]Estudante[Ô])[ô];
$.ajax({
type: [Ô]GET[Ô],
url: url,
dataType: [Ô]json[Ô],
contentType: [Ô]application/json; charset=utf-8[Ô],
data: JSON.stringify({ tipo: tipousu, matricula: mat, categoria: categoria }),
success: function (data) {
console.log(data);
$([Ô]#usuario[Ô]).html(data);
},
error: function (jqXHR, textStatus, errorThrown) {
alert(errorThrown);
alert(errMsg);
}
});
Meu API controller está assim :
[HttpGet]
[Route([Ô]{categoria:int}/{matricula}/{tipo:int}[Ô])]
[ActionName([Ô]Get[Ô])]
[ResponseType(typeof(Estudante))]
public async Task<IHttpActionResult> GetByData(int categoria,string matricula,int tipo)
Já adicionei uma rota, mais tb não dá certo, alguém tem mais alguma ideia ?
Quando eu usava AJAX as pesquisa eram por POST passando paramêtro pelo DATA
$([Ô]#txtMaterialEntry[Ô]).focusout(function () {
debugger;
fJS_ClearMaterialAdd();
if ($(this).val() != [Ô][Ô]) {
$.ajax({
url: base_url + [ô]/ws/stock/material/search[ô],
type: [ô]Post[ô],
dataType: [ô]json[ô],
data: { [ô]materialname[ô]: $(this).val() },
beforeSend: function () {
$([Ô]#gridbodyStockSearchMaterial[Ô]).html([ô]<tr class=[Ô]gradeA[Ô]><td colspan=[Ô]4[Ô] style=[Ô]padding: 5px 0 10px 0;text-align:center[Ô]><h3><strong>[ô] + JSResource.SearchRegulation + [ô]</strong></h3><br><img src=[Ô][ô] + base_url + [ô]/Content/eclinic/img/ajax-loader-42x33.gif[Ô] border=[Ô]0[Ô] /></td></tr>[ô]);
$([ô]#pnlStockSearchMaterial1[ô]).show();
$([ô]#pnlStockSearchMaterial2[ô]).show();
$([ô]#pnlStockSearchMaterial3[ô]).show();
$([ô]#pnlStockSearchMaterial4[ô]).show();
},
success: function (response) {
fJS_StockSearchMaterialEntryLoadGrid(response);
},
error: function (e) {
console.log([Ô]Error details: [Ô] + e.responseText);
$([Ô]#gridbodyStockSearchMaterial[Ô]).html([ô][ô]);
$([ô]#pnlStockSearchMaterial1[ô]).modal([ô]hide[ô]);
$([Ô]#modalScheduleAdd[Ô]).modal([ô]hide[ô]);
$(window).scrollTop(0);
fJS_ShowError(JSResource.MsgFailedSearch, [Ô][Ô]);
return false;
}
});
}
else {
$([ô]#pnlStockSearchMaterial1[ô]).slideUp();
$([ô]#pnlStockSearchMaterial2[ô]).slideUp();
$([ô]#pnlStockSearchMaterial3[ô]).slideUp();
$([ô]#pnlStockSearchMaterial4[ô]).slideUp();
}
});
F001E, é um dos problemas que o OP está com dificuldades. Ele está usando o verbo GET e passando parâmetro [Ô]data[Ô]. Estou dando respostas assim genéricas justamente para que ele veja por si o que está fazendo.
Tópico encerrado , respostas não são mais permitidas