473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Ajax.Updater doesn't work / scriptaculo.us

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

Jun 3 '06 #1
1 3143
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...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

ma**********@googlemail.com wrote:
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


Jun 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sgmaat | last post by:
I have create a AJAX webpage where if you press a link content is loaded into a div. NOw when this content is loaded no javascript is processed (i.e <Script>alert(..);</script>), but if the...
2
by: hardrock | last post by:
Hello! I'm working with the prototype library version 1.4.0 and having a strange error lately. When I want to make an Ajax.Updater call, it basically works. But as soon as I put the call into...
7
by: BeeRich | last post by:
Hi folks. I built an ajax.updater reply in a website on a Mac, and she works fine. It's a simple reply, the html supplied is correct, and I also supply the target DIV as well. Just wondering...
3
by: noballack | last post by:
I've got a problem, I'm working with Ajax in a web with a form with a list of checkbox added to the form via an Ajax.Updater method. These added checkboxs are not been sended by the form if I use...
25
by: meltedown | last post by:
This is supposed ot be an example: http://www.ajaxtutorial.net/index.php/2006/11/30/simple-ajax-using-prototype-part-2/ It says : This example is probably the simplest example you will ever...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
1
by: conspireagainst | last post by:
Is there any possible way (I'm using prototype framework) to glean what the name of the container element to be updated (using Ajax.Updater) is? I have appended at the bottom of prototype.js a...
8
by: luftikus143 | last post by:
Hi there, I recently upgraded to Firefox 3 and suddenly my Ajax.Updater doesn't work anymore. Firefox gives me a "Security Error"... I am using the recent versions of prototype and script.xx.us. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.