Why is my ajax request not working?

Asked

Viewed 85 times

-2

<script type="text/javascript">
         
          $('#enviar').click(function(){

            $.ajax({
          type: 'post',
          data: '',
          url:'<?php echo base_url('admin/salvar_produto'); ?>',
          success: function(retorno){
          notify.showNotification('top','right')
        
      }
       })}
</script>

  • Is missing the echo <?php echo base_url('admin/salvar_produto'); ?> or was a typo in the question?

  • yes was missing ;) my inattention

1 answer

1


One thing that helps is to devise the code

<script type="text/javascript">

          $('#enviar').click(function(){

            $.ajax({
            type: 'post',
            data: '',
            url:'<?php base_url('admin/salvar_produto'); ?>',
            success: function(retorno){

              notify.showNotification('top','right')

            }
       })
 }/*faltou esse parenteses ->*/)
</script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.