Displaying 20 results from an estimated 20000 matches similar to: "Javascript as content parameter for update_element_function?"
2006 Feb 05
0
Using javascript with update_element_function
Hi,
I am using evaluate_remote_response and update_element_function, to update
elements with blocks of content, something like this:
<% update_element_function("div_id", :binding => binding) do %>
<div id="newdiv_id">
This is a new div!
</div>
<%= draggable_element(''newdiv_id'') %>
<% end %>
That will update the
2005 Dec 07
3
update_element_function fail gracefully?
I am using the update_element_function to update the text in some
elements. This works fine, however, if I try to update an element
that is not on the page anymore, it fails silently and no further
javascript statements will be executed within that same
request.responseText. Is there a way to fail gracefully in this
scenario and ignore the missing elements?
Thanks,
Tom
2006 Feb 01
0
Using draggable_element doesnt work with update_element_function
Hi everyone,
I am writing a ruby on rails application, and making heavy use of AJAX calls
and evaluate_remote_response. In my remote responses I often have several
update_element_function calls going on, to update several divs on the page.
What I am doing is calling update_element_function, with the content as a
block. Inside the block I usually have html, or make calls to other partials
or
2006 Feb 03
2
JavaScript Prototype Help?
I have a form with a text area. I want to have an observer watch the
text area and update a div with the running count of characters in
the text area. I tried "onchange" but that doesn''t update until you
leave the text area. I was able to get it working using AJAX, but
it''s silly to make a needless round trip to the server, when the page
already knows
2006 May 04
3
Problem using url_for
I''m trying to generate a URL of the form
controller/action?id=<id>&type=<type>. My code looks like this:
url_for(:controller => ''content'',
:action => ''get_resource'',:id => item[''Id''],:type => item[''type'']
)
The url I end up with looks like this:
2005 Dec 24
2
Ajax Help: Multiple Updates - ?
Hi!
Wondering if anyone can tell me what''s wrong with my code?
I''m trying to use the onChange event of a select list to update multiple
divs...
Agile Web Development with Rails (p. 403) suggests using ":complete =>
eval(request.responseText) instead of :update"
I''ve attempted the following test code:
# in the view
<select name="plist",
2006 Jun 14
3
problem trying to update multiple <DIV> elements with AJAX
I''ve been trying for days now to figure this out on my own, but I can''t,
so this is my cry for help. Here''s my situation: I need to update
multiple <DIV> elements on a page, each with its own HTML, but I just
can''t figure out how to get it to work. That is, I want to replace
everything within each <DIV> element with something new. When I try what
2005 Dec 27
1
Rails/Ajax question from a newbie (to both)
I''m trying to get a Rico LiveGrid working, and I am a bit stuck on how to
accomplish this.
I have a page that successfully queries a controller and updates a <div>
containing a table. I have two
versions of the action; one uses the render_partial to return a rendered
version of that table, and the
other returns an XML-RPC document, and this is where I hit a snag.
The Rico LiveGrid
2005 Dec 27
0
update_field question
I''m using update_field to update a <div> with the contents of a
text_area as it''s updated by the user (a-la-Typo preview style).
I''m now trying to preload the <div> so that it shows the contents of the
field being edited even if that field doesn''t get edited. In other
words, update_field is only called if the field is updated, but I want
the
2011 Jan 20
0
Saving a webpage, when content is generated by javascript
Hi to all members of this group,
how can i download a webpage using R (html), which is generated using
javasript when trying to open that webpage in the browser?
When i try to save the page as text file i get only some java code inside,
not the actual data.
When opening website in the browser and saving the page in txt file
everything works fine, so seems like i need to emulate browser request
2006 Nov 13
4
Mass filtering page content for javascript anti-spam script
Hi all,
I''d like to write a function that replaces all email addresses in my
pages with a javascript anti-spam script. I know it''s a bit horrible
for screen readers, but I feel it''s our best option at the moment.
I think I need some kind of function that builds the javascript
depending on the email address and then replaces it in the text. I got
a bit lost at this
2005 Sep 01
0
Teething problems with Ajax.updater
Hi all,
Forgive what I expect is a silly question.
I have the following code:
#CONTROLLER
def calculate
render :partial => ''calculate''
end
#CALCULATE PARTIAL
<%= update_element_function("update_1", :position => :bottom, :content
=> "<p>New product1!</p>") %>
#VIEW
<p><label for="order_unit_price">Unit
2008 Feb 08
0
javascript parameter problem with onsubmit
Hi
I have this problem:
<script>
var param1 = ''field3'';
</script>
<script>
var param2 = ''field3'';
</script>
<script>
var param3 = ''field3'';
</script>
<%= submit_tag ''Next'', {:onsubmit => ''return
validate_options(param1,param2,param3);''} %>
function
2006 Feb 28
2
AJAX: do render but show element in same click?
I''m a rails newbie.
I''ve got a link_to_remote that puts a partial render into a div
("note1", "note2", etc.). As part of the display that comes up, I put
in a hide note link (element.toggle). Click that, the div goes away,
everything''s great... except now I can''t get it back.
How can I call the remote AND make the div show at the same
2006 Jul 14
4
Help with link_to_remote or javascript generator
Hi all,
I''m a relative noob to rails so I apologize in advance for asking such a
basic question.
I am trying to do multiple AJAX calls using the link_to_remote helper or the
JavaScript generator update_page. I have googled and read the docs for
both, but can''t seem to figure out exactly what i need to do.
Say I have the following html:
<div
2006 Jan 01
0
Using standard helper methods in my helpers
Hi... I''ve written some simple helper method. My method uses standard
helper methods from Rails. When I try to use them from templates -
everything is working, but when I try to execute from my helper I get an
exception. Here is my code:
module ApplicationHelper
def reset_add_function
r=update_element_function("add") {
link_to_remote( "Nowy watek",
2005 Jul 22
2
Unpredictable behavoir using Sortable javascript
Hey all,
I''m attempting create a photo album that can be re-ordered using the great
scipts from script.aculo.us <http://script.aculo.us>. It seems to work as
expected when I pretty much copy and paste the puzzle example but when I try
and be a bit trickier (changing the movable elements to be divs containing
images) things get wierd. I''m able to "pick" the
2006 Apr 11
2
link_to_remote to update multiple components
How would go about to update multiple components when using
link_to_remote?
I''ve got a button that lets you switch between languages and it has to
update every component in my application (like, let''s say: the main
screen, the top navigation bar and the search bar). Each component is
created in a different DIV and whenever the language is switched, the
entire application
2005 Aug 30
0
content slide in out / simple toggle of content
Hi All,
I have been trying to get a toggle tab system working with protoype
effects. The best example of what I want is shauninman.com (the nav/search)
I intend to have a sidebar and an expandable horizontal tab both of
which can be toogled in and out of place.
for example the sidebar (which will contain a tree menu (like windows
explorer))
Mark Up
---
<div
2006 Jan 14
14
Javascript/AJAX Debugging
Hello !
I''m trying to implement something similar to the "multiple updates" section
of the Web2.0 chapter of the Agile book.
I implemented my version, and nothing is happening. No javascript errors,
my logs look fine, page is rendered fine... just no Effect.Highlight. Here
is the code:
views/causes/cause_home/index.rhtml
===============
<%= form_remote_tag(:complete =>