JS and position attribute

In AJAX helper is option position, that append returned data to this element.:


<div id="post">
</div>
<?php echo $ajax->link( 
    'View Post', 
    array( 'controller' => 'posts', 'action' => 'view', 1), 
    array( 'update' => 'post', 'position' => 'top'  )
); 
?>

Is something similar in Js helper? I'm using CakePHP 1.3 and jQuery.

Asked by atlet, on 21/2/12

Here is the solution:

$("#myLink").click(function()

{

$.get('Html->url(array('controller' => 'posts', 'action' => 'add')); ?>',function(data)

{

$(data).appendTo('#posts');

});

});

atlet - on 21/2/12

<< comments | comments >>

0 Answers

Sorry, but there are no answers yet.

Your Answer

You can use Creole Wiki Syntax to format your text.

Rating

0

Viewed

292 times

Last Activity

on 21/2/12