javascript - onclick send data to another page -


im trying use onclick function send url page in php. have similar function add function remove nothing, removes button page. no errors visible in console either.

this function:

function remove(id) {     $.ajax({         type: 'post',         url: 'cart.php?remove='+id,         success: function ( response ) {           alert( 'removed: '+id );         }       }); } 

i have tried alert('some text'); same thing. button is:

onclick="remove(<?php echo $value; ?>)" 

the button on cart.php being included on main.php


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -