Ajax.Updater doesn't work / scriptaculo.us

M

marc.fuehnen

hi everybody,

tried the framework and build a little SQL Update, triggered by a JS
function:

<a href="Javascript:updateData()"><img
src="../images/thumbs/thumb_blue.png" border="0" /></a>

<div id="yeah">

<?php foreach ($movies as $item => $value) { ?>

<?= $value['title'] ?>
<?= $value['playing'] ?>

<?php } ?>

</div>

<script type="text/javascript">

function updateData() {

var options = {
method : 'post',
postBody : 'id=1&value=44'
};

new Ajax.Request('update.php', options);

}

</script>

SQL Update is working (value changes from whatever to 44 in the
database). But the value in the DIV is not refreshing. I think I don't
know how to handle the Updater...

new Ajax.Updater('yeah', 'test.php', {asynchronous:true});

That's the way I have it now, but don't know

- where to put it ?
- whether I inserted the right URL (test.php is the DIV's page) ?
- whether I have to say new Ajax.Updater or just Ajax.Updater ?

I hope you can help me - the mini manual on scriptaculo.us says nothing
about it...

Thx, Marc
 
P

petermichaux

Hi Marc,

Re your post below.

I think you might have better luck asking about prototype.js on the
rails-spinoffs mailing list which you can join

http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

If you do ask there, it might be a good idea not to send the
server-side document with php. Instead do a save as in the browser and
take the relevant parts of that html/javascript page to make an email
to the spinoffs list. The folks there may not know php.

If you are using php then you don't have the semi automatic connection
to prototype.js that a Ruby on Rails application has. Also a lot of
prototype.js is to simulate Ruby. Have you searched the archives here
to see how much many people dislike prototype.js? There are some good
reasons. Documentation is one.

Have you looked at the Yahoo! UI connection manager?

http://developer.yahoo.com/yui/connection/

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top