Hi Folks! I’m new in the forum and i have a doubt. The button back
function with the Ajax on Rails? tks.
Your question is a little vague but I’ll assume I understand it.
Any AJAX stuff you do essentially “breaks” the back button in the
sense that the browser doesn’t “know” about the incremental page
changes taking place via AJAX. So if you go from Page A to Page B and
then update three HTML elements on Page B and hit the Back button in
the browser, you’re back at Page A (and presumably all your changes
to Page B are gone).
That’s one of the main criticisms of using AJAX; it breaks the basic
navigational paradigm. It’s not hard to design your Web apps so
that this doesn’t become an issue (always open your AJAX pages in a
new window and confine your AJAX apps – or logical segments thereof
– to single pages), but it does require some additional thinking.
HTH,
On Jan 11, 2006, at 8:14 PM, Junior Marçal wrote:
Hi Folks! I’m new in the forum and i have a doubt. The button back
function with the Ajax on Rails? tks.–
Posted via http://www.ruby-forum.com/.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Dan S.
Technology Visionary - Technology Assessment - Documentation
“Looking at technology from every angle”
Junior Marçal wrote:
Hi Folks! I’m new in the forum and i have a doubt. The button back
function with the Ajax on Rails? tks.
A properly designed page should not use AJAX in such a way that the back
button is broken. If you have two pages which logically should be
referenced via different URLs, i.e., they’re actually difference
resources, then you shouldn’t be transferring from one to the other with
AJAX.
AJAX should only be used to edit in-page items. For example, if you
have a form which sends mail then a sensible use of AJAX would be to
send the email asynchronously and change the input forms to a success
message when complete. Another example would be in-place editing of
lists, say, of bookmarks.
–
Jesse F. [email protected]
University of Chicago - NSIT Web Services
AIM: farmerje
Jabber: [email protected]
Phone: (773)363-1058
Junior Marçal <jcalled@…> writes:
Hi Folks! I’m new in the forum and i have a doubt. The button back
function with the Ajax on Rails? tks.
There are way to preserve state across page views so that browser
history (back
and forward buttons) and bookmarking works in javascript/AJAX
applications.
Some AJAX frameworks, such as the DOJO toolkit, include a history
mechanism.
The javascript libraries that ship with Rails (prototype and
script.aculo.us) do
not, so you’ll have to write one yourself. Read this blog post if you
want to
learn more about how to do it:
http://codinginparadise.org/weblog/2005/08/ajax-tutorial-saving-session-across.html
I’ve had a mixed experience implementing the approach detailed in that
blog
post. Everything works great out of the box in Firefox (and Safari
IIRC), but
IE was a nightmare. IE doesn’t repopulate form values (the basis of the
history
mechanism in the post above) unless you’ve got your cache HTTP headers
(cache-control and IE-specific ETag) set in the response. But caching
doesn’t
work well if the page in question has dynamic content. IE also refused
to
repopulate form values in iframes even with the cache control header set
making
it impossible to separate dynamic content from the content that requires
the
history mechanism.
Tyler
On Thursday 12 January 2006 12:44 am, Jesse F. wrote:
AJAX should only be used to edit in-page items. For example, if you
have a form which sends mail then a sensible use of AJAX would be to
send the email asynchronously and change the input forms to a success
message when complete. Another example would be in-place editing of
lists, say, of bookmarks.
How bout field level validation?
SteveT
Steve L.
Author:
- Universal Troubleshooting Process courseware
- Troubleshooting Techniques of the Successful Technologist
- Rapid Learning: Secret Weapon of the Successful Technologist
Webmaster - Troubleshooters.Com
- http://www.troubleshooters.com
Steve L. wrote:
How bout field level validation?
As long as you don’t absolutely rely on it, I can’t see any reason not
to use it…
Steve L. wrote:
AJAX should only be used to edit in-page items. For example, if you
have a form which sends mail then a sensible use of AJAX would be to
send the email asynchronously and change the input forms to a success
message when complete. Another example would be in-place editing of
lists, say, of bookmarks.How bout field level validation?
Sure, why not? You have some form to create, say, a listing which
submits the data asynchronously to ListingController’s create method.
Any errors can be fetched asynchronously, and on success you can delete
all the form elements and display a “success” message. The create
method could re-render the form entirely so you get the fancy CSS stuff
Rails does, and you just blank the old form and replace it with the
asynchronously fetched form.
I actually think AJAX can be used to unbreak the back button. Many
times you’re in a state where going back takes you to stale data. This
can be dangerous in the case of submitting a form where there is the
potential for submitting the data twice, either by going back from the
“success” page or by hitting refresh on the “success” page, thereby
POSTing all over again.
–
Jesse F. [email protected]
University of Chicago - NSIT Web Services
AIM: farmerje
Jabber: [email protected]
Phone: (773)363-1058
For ajax form validation, you should consider RJS, as described at
techno-weeniehttp://rails.techno-weenie.net/tip/2005/11/29/ajaxed_forms_with_rjs_templates
Roberto S. wrote:
For ajax form validation, you should consider RJS, as described at
techno-weenie
http://rails.techno-weenie.net/tip/2005/11/29/ajaxed_forms_with_rjs_templates
That’s pretty cool. I’ll have to look into it!
–
Jesse F. [email protected]
University of Chicago - NSIT Web Services
AIM: farmerje
Jabber: [email protected]
Phone: (773)363-1058
On 1/11/06, Junior Marçal [email protected] wrote:
Hi Folks! I’m new in the forum and i have a doubt. The button back
function with the Ajax on Rails? tks.
AJAX: How to Handle Bookmarks and Back Buttons
by Brad Neuberg
10/26/2005
This article presents an open source JavaScript library that finally
brings bookmarking and back button support to AJAX applications. By
the end of this tutorial, developers will have a solution to an AJAX
problem that not even Google Maps or Gmail possesses: robust, usable
bookmarking and back and forward behavior that works exactly like the
rest of the Web.
–
Posted via http://www.ruby-forum.com/.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Jon S.
[email protected]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jesse F. wrote:
I actually think AJAX can be used to unbreak the back button. Many
times you’re in a state where going back takes you to stale data. This
can be dangerous in the case of submitting a form where there is the
potential for submitting the data twice, either by going back from the
“success” page or by hitting refresh on the “success” page, thereby
POSTing all over again.
This is better solved by using redirects after a submit operation, then
the
update page is never available for a reload.
David M.
Maia Mailguard - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFD1raJSIxC85HZHLMRArJ1AJ0Tw9ZwwWWXJYvmqvnRlkv2VBhTEQCfWhkg
+ZRGqYQA5mGcHBf9YHgIKl8=
=oleG
-----END PGP SIGNATURE-----
oops, it was a typo, the js file loads, but gosh darnit, this seems
hard.
has anyone actually pulled this off adding partials to
DhtmlHistory.add() ?
and how would we go about this with the RoR structure and the use of
iframes?
Dominic wrote:
I’m actually trying out this tutorial at
Radar – O’Reillyand included the file dhtmlHistory.js where all the other javascript
files are.but when a javascript function is called, it says 'error undefined
method ‘this’ in the dhtmlHistory.js library script.‘this’ is a regularly used object in js…what gives?
Dominic
David M. wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Jesse F. wrote:
I actually think AJAX can be used to unbreak the back button. Many
times you’re in a state where going back takes you to stale data. This
can be dangerous in the case of submitting a form where there is the
potential for submitting the data twice, either by going back from the
“success” page or by hitting refresh on the “success” page, thereby
POSTing all over again.This is better solved by using redirects after a submit operation, then
the
update page is never available for a reload.
David M.
Maia Mailguard - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.orgiD8DBQFD1raJSIxC85HZHLMRArJ1AJ0Tw9ZwwWWXJYvmqvnRlkv2VBhTEQCfWhkg
+ZRGqYQA5mGcHBf9YHgIKl8=
=oleG
-----END PGP SIGNATURE-----
I’m actually trying out this tutorial at
and included the file dhtmlHistory.js where all the other javascript
files are.
but when a javascript function is called, it says 'error undefined
method ‘this’ in the dhtmlHistory.js library script.
‘this’ is a regularly used object in js…what gives?
Dominic
David M. wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Jesse F. wrote:
I actually think AJAX can be used to unbreak the back button. Many
times you’re in a state where going back takes you to stale data. This
can be dangerous in the case of submitting a form where there is the
potential for submitting the data twice, either by going back from the
“success” page or by hitting refresh on the “success” page, thereby
POSTing all over again.This is better solved by using redirects after a submit operation, then
the
update page is never available for a reload.
David M.
Maia Mailguard - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.orgiD8DBQFD1raJSIxC85HZHLMRArJ1AJ0Tw9ZwwWWXJYvmqvnRlkv2VBhTEQCfWhkg
+ZRGqYQA5mGcHBf9YHgIKl8=
=oleG
-----END PGP SIGNATURE-----