Displaying 20 results from an estimated 3000 matches similar to: "[Prototype] understanding evalScripts"
2006 Apr 18
7
[Prototype] evalScripts not working for me
I think I am experiencing the variable scope problem with evalScripts.
I have this block of code being returned from an Ajax.Updater call,
as shown by FireBug or one of those other Firefox plugins. I have
tried to boil it down to the minimum code.
<script type="text/javascript">
test = function() { alert("test"); };
</script>
<table
2008 Aug 25
1
prototype.js Ajax is slow
So I was doing some experimenting with prototype and ajax and discovered
something interesting. When I use the first ajax call the response from
the server take 53ms. When I use the second on using the prototype
functions the request from the server is over 200ms. My question is
why, and can it be fixed?
<p><a href="#" onclick="serverSideAlert();">Call
2007 Nov 19
1
Running a script after evalScripts has completed
Hello,
(I originally posted this on the Prototype-Core group by mistake,
sorry)
I am running a request via Ajax.Updater with evalScripts = true and an
onComplete function.
I find that my onComplete function executes before the script content
has been evaluated. Looking through prototype.js (v. 1.5.1) this seems
to be caused by the scripts being executed as part of this line
(1352):
2006 Apr 15
11
evalScripts in IE
My Ajax.Updater is set for evalScripts and it receives this:
<script language="JavaScript">complete();</script>
It works in FF but not IE. Is the above code the proper way to return
scripts?
Thanks!
2007 Jun 27
1
Prototype 151; Ajax.Updater vs Ajax.Request and evalScripts=true
Why does Ajax.Updater() and Ajax.Request() differ in how evalScripts
is handled? Or doesn''t it, and I just got it wrong?
I have a module that generates an Ajax request to insert dynamic
content into a div. The dynamic content is plain vanilla HTML with
some inline javascript *functions*
I cannot get the browser to honor/execute/see those javascript
functions when I use .Request()
If I
2006 Feb 28
5
browser-crash with Ajax.Updater
Hi,
on my page I start an ajax-request which returns rhtml-code (I use
Rails) looping over some objects. When I place the following code within
the loop my browser (FF) crashs:
<script>
var set_std_objekt = function (id) {
new Ajax.Updater(''divname'', ''/dosomestuff'', {
asynchronous:true,
evalScripts:true
})
}
</script>
<a
2005 Dec 12
7
possible opera+prototype bug in evalscripts?
Hi all,
I use the ajax updater with evalscripts=true.
When I load HTML with included <script> tags, I get this error in Opera 8.51:
------------------- snip -----------------------------
http://ccml.uni-weimar.de/
Timeout thread: delay 10 ms
Error:
name: EvalError
message: Statement on line 258: Illegal use of eval
Backtrace:
Line 258 of linked script
2005 Dec 31
9
RJS Templates not conducting callbacks
I''ve run across a weird problem with RJS that I''m trying to figure out:
I have an application that was running 0.13.1 that I recently upgraded
to Rails 1.0. I wanted to use RJS templates, so I installed the plugin
and updated my prototype javascript file via ''rake update_prototype.''
I attempted to test the templates out via the following code, but the
AJAX
2006 Mar 21
16
Javascript Code inside an Ajax response
Hi, i wish to run a function that came inside my Ajax response. I read
that i have to use the evalScripts to make this, but still i couldn''t
make it work. The error said that my function isn''t declared. I look
at the Sergio Pereira tutorial about use the var xxx = function() but
still doesn''t work.
Someone could help me?
In the response this is the code:
for (var i =
2006 Apr 27
12
Execute controller function from RJS
Hi all,
I wonder if it is somehow possible to execture or redirect to a
controller function from RJS?
Right now I do:
def foo()
render :partial => ''executeagain''
end
_executeagain.rhtml
<script>
new Ajax.Updater(''elmntID'', ''/test/foo/'', {evalScripts:true});
</script>
This will loop I know :)
How can I achieve the same
2006 Jun 28
2
Assign CSS class to Link to Remote
I''m trying to get link_to_remote to assign a CSS class to the link it
generates. My code is as follows:
<%=
link_to_remote "Show Full Info",
:update => "fullcontact" + reparray.last.to_s,
:url => "/cm/full_contact/" + reparray.last.to_s,
:classname => "contactlink"
%>
Which produces this HTML:
<a href="#"
2006 Mar 01
9
ajax doesn''t show at the right place
Hi,
I use link_to_remote to create a link to trigger an
ajax, things work fine, a new rhtml is created,
however, the newly created rhtml doesn''t replace my
old zone, it shows instead on top of my old
zone...Does someone know why???
my code is like
<table>
<tr><td colspan="2"><a href="#" onclick="new
Ajax.Updater(''zone1'',
2007 Oct 24
3
addClassName and removeClassName
Hi, and sorry for the noob question!
I have an unordered list of 4 links where the links use Ajax.Updater
in the onclick:
onclick="new Ajax.Updater(''ajaxarea'', ''link1.php'', {asynchronous:true,
evalScripts:true }); return false;"
How would I go about using addClassName and removeClassName to show
the current link?
Thanks for any help with this.
2006 Aug 25
3
RJS Error: Element.update is not a function
Hi,
I have implemented some RJS code and I have the same exact code in 2
different places. In one place I get the error "Element.update is not
a function" and the other place works fine. Any idea why this error is
coming? Breaking my head.
-Vinod
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2007 Oct 12
5
Evalscripts
Hey all,
I''m just checking my understanding. Would someone be so kind as to
comment on the following?
Event.observe(''this_link'', ''click'', function() {
AJAX.Updater(''that_div'', ''my.php'', { evalscripts: true}) });
<div that_div>
</div>
///////
my.php
2005 Oct 16
13
More than one parameter with link_to_remote
Hi all,
I''m trying to pass more than one parameters using link_to_remote, but I''m
getting a behaviour that seems quite strange to me. Here''s the code:
link_to_remote ''some text'',
:update => ''form'',
:method => ''get'',
:url => { :action =>
2008 Apr 21
4
Does String.evalScripts() work on well-formed script tags?
Does String.evalScripts() work when the opening SCRIPT tag of a SCRIPT
block contains common attributes? I''ve tried and it does not appear
to be working. Here''s an example:
<script type="text/javascript" charset="ISO-8859-1"
language="JavaScript">
//<![CDATA[
<!--
alert(''look! it works!'');
//-->
//]]>
2007 Jan 24
7
Differences between assert_tag and assert_select
Hi all,
I can't seem to make assert_select work for the more complex cases for me.
Here's a sample:
# View
<%= link_to_remote 'Add new', :url => new_phone_url, :submit => 'phones_head' %>
# Generated code:
<a href="#" onclick="new
Ajax.Request('http://test.host/admin/parties/phone/new',
{asynchronous:true, evalScripts:true,
2008 Jan 23
11
Rails 2.0.2 + RJS
Hi
I had ajax commenting on my app, which worked perfectly on Rails
v1.2.6, but does not work the same in Rails 2.02. Basically the
comment gets added, but the visual effects do not work (ie lines 2 + 3
of create.rjs)
create.js
page.insert_html :bottom, ''comments'', :partial => ''comment''
page.visual_effect :appear, "comment_#{@comment.id}"
2007 Sep 06
1
semi-nube help request
just to show i''m not a complete dork: i receive emails from the list through
gmail and i''ve already searched for the answer to this problem and since
i''ve been a member i''ve not received an email about it. Google search
results are mixed at best.
so this is my problem:
i have a form:
<div id="container"