List Info

Thread: javascript question




javascript question
user name
2006-05-31 14:18:38
Javascript question :(

Well, I use ajax to set some value to a textarea...

$('element').value = 'myvalue';

but, if my value contain "\n" caracter, it not
works,

not that "\n" comes from my database..

tks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Cake PHP" group.
To post to this group, send email to cake-phpgooglegroups.com
To unsubscribe from this group, send email to
cake-php-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

javascript question
user name
2006-05-31 14:45:14
there's one method at javascript helper something like
"safe_string" .
it adds slashes to the string,
then you can do a $('element').value = "<? echo
$value?>"

It will be replaced by $('element').value=
"my\nvalue".


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Cake PHP" group.
To post to this group, send email to cake-phpgooglegroups.com
To unsubscribe from this group, send email to
cake-php-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

javascript question
user name
2006-05-31 16:43:10
You can use JavascriptHelper::escapeScript or
JavascriptHelper::escapeString in your views:

http://api.cakephp.org/class
_javascript_helper.html#978e93e972b1ff7c48f5f892bbf8b6c5


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Cake PHP" group.
To post to this group, send email to cake-phpgooglegroups.com
To unsubscribe from this group, send email to
cake-php-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )