[Proto-Scripty] simple question on Prototype (methinks...)

2010-02-28 Thread Grary
Hi,

I've inherited a project with some Prototype connections I do not
understand.

To wit, I'd like to modify the following javascript function so that I
can append to the link element, not replace the content:

function add_fields(link, association, content) {
var new_id = new Date().getTime();
var regexp = new RegExp("new_" + association, "g")
$(link).up().insert({
after: content.replace(regexp, new_id)
});
}

Any suggestions?

Thanks,

Grar

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Simple question

2008-11-26 Thread justclint

Im just getting into script.aculo.us by way of cakephp. As for
javascript frameworks Ive only used jquery.

This question is so basic I cant find anything on past posts here in
the groups hence this post.

Basically I just took a random effect and it worked as described in
the github area by applying it to an element selected by id.

Im trying to get the effect to work "not by id" but by "this". Heres
my example but not working:

script:


  // 



html


  Click me to fade away


  or click me to fade away



I dont see any documentation on how to apply to "document.this"

Im sure my syntax is wrong but everyway I switch it around it still
wont work.

What am I doing wrong?

Thanks in advance!

jc

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Simple $( ) question

2008-11-06 Thread Scott

If I have an element:

  50

Should I be able to say the following?

  var total = parseFloat($('foo'));

Instead, I am getting a return value of:

  [object HTMLSpanElement]

and parseFloat is returning NaN.

Thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---