On 1/7/07, mwaschkowski <[EMAIL PROTECTED]> wrote:

Ya, that looks good Bob, thanks! I had considered this already (and
failed to mention in my posting) and your implementation is excellent.
I was hoping for something a bit more generic that could be used with
any replace values and any string. The only problem is its a bit less
flexible than just doing a

mochikitEvent.src().value.replace(/\n/gi, "<br>");

because I would have to make a function for every tag that I might want
to replace, or write more code...hold on a sec. I just noticed another
function in the docs that might do the trick:

No it's not. Just parameterize it so that the tag object and the regex
are arguments to the function.

  clone(o)

so a function like this could be written?

  replace : function (string, replaceString, replaceWithElement)

and do a lookup for the replaceString and replace it with:

  clone(replaceWithElement)

which would work with any replace string and element...

clone is not suitable for DOM objects. DOM methods must be used for
cloning DOM nodes.

-bob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to