not execute a click event
Here my code:
- $(document).ready(function () {
- $(".verDetalle").click(function () {
- alert('111');
- var widsala = $("#xcombsalas option:selected").val();
- var whtml = '';
- $.ajax({
- method: "post",
- url: "ajax/a_pallcmapasala.jsp",
- data: {
- "xidsala": widsala,
- "xtypo": 3
- }
- }).done(function (xhtml) {
- whtml = xhtml;//.responseText;
- // console.log(whtml);
- document.getElementById("xtablaDispSalaDetalle").innerHTML = whtml;
- }).fail(function () {
- alert("error");
- });
-
- });
- $('#xcombsalas').on('change', function () {
- // alert('1');
- var widsala = $("#xcombsalas option:selected").val();
- var whtml = '';
- debugger;
- $.ajax({
- method: "post",
- url: "ajax/a_pallcmapasala.jsp",
- data: {
- "xidsala": widsala,
- "xtypo": 1
- }
- }).done(function (xhtml) {
- whtml = xhtml;//.responseText;
- // console.log(whtml);
- document.getElementById("xtablaSala").innerHTML = whtml;
- }).fail(function () {
- alert("error");
- });
- $.ajax({
- method: "post",
- url: "ajax/a_pallcmapasala.jsp",
- data: {
- "xidsala": widsala,
- "xtypo": 2
- }
- }).done(function (xhtml) {
- whtml = xhtml;//.responseText;
- // console.log(whtml);
- document.getElementById("xtablaDispSalaMaster").innerHTML = whtml;
- }).fail(function () {
- alert("error");
- });
- });
- });
The user click on SELECT/OPTION: id='#xcombsalas'
the line:
url: "ajax/a_pallcmapasala.jsp",
build a html Table with a button the class of the button is: 'verDetalle' see the line2:
when the user click on 'VerDetalle' Button not display the alert..... not know why.
i think when the user click on SELECT/OPTION: id='#xcombsalas' at this moment not know exists the button and or event.
any advice how to solve?
thanks