php - Ajax request isn't working in cakephp -


i'm trying ajax request in cakephp.
submit #enviar. action pages/contato.

this ajax request:

$(document).ready(function() {     $('#enviar').click(function(){         $.ajax({             type: 'post',         url:"<?php echo router::url(array('controller' => 'pages','action' => 'contato')); ?>",         })     }) }); 

i change $.ajax simple alert() , when click submit works.
problem?

better change url, in ajax function :-

$.ajax({         type: 'post',     url:"http://localhost/teste/pages/contato"     }) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -