Tengo una pagina que busca un articulo y posteriormente permite agregar características. Como tal debe tener la opción de eliminar alguna característica agregada.
Tengo mi link para eliminarla pero no recibe los parametros mi función. Utilizo el ajax y jquery. El problema esta ne la linea donde esta cadSoftware += ...
Aqui esta el codigo:
Código:
El código de la función eliminar es la siguiente:function addSoftware() { var i = 0; var seleccionSoftware = $("#seleccion-tipo-software option:selected").val(); var nombreSoftware = $("#seleccion-tipo-software option:selected").text(); $.ajax({ type: "POST", url: "addSoftware.php", data: ({ folio: folioCompleto, tipoSwId: seleccionSoftware }), cache: false, dataType: "json", success: function (data) { $.ajax({ type: "POST", url: "muestraSoftware.php", data: ({ idSoftware: seleccionSoftware, folio: folioCompleto }), cache: false, dataType: "json", success: function (data) { if(data.length > 0) { var cadSoftware = ""; for (var j = 0; j < data.length; j++) { var k = data[j]; cadSoftware += k.nombre + " [<a href='#' onclick=eliminarSoftware('k.id', 'folioCompleto');> Borrar </a>] <br>"; } $('#softwareAgregado').append(cadSoftware); } } }); $.mobile.hidePageLoadingMsg(); } }); }
Código:
Muchas gracias de antemano =D function eliminarSoftware(idSW, folioBien) { $.ajax({ type: "POST", url: "eliminarSoftware.php", data: ({ idSW: idSW, folio: folioBien }), cache: false, dataType: "json", success: function() { alert("Eliminado"); } }); }