I have the following text in a field from my database:
Studied project requirements and documented specifications accordingly Developed routing models for PDMS piping and associated equipment Designed 3D illustrations for rough and final layout of piping routes and structures Created elevated support system for complex piping structures to ensure proper functioning and safety Provided detailed fabrication drawings Performed stress and functional tests for new and existing designs Upgraded existing layouts and structures as per the design and safety standards Prepared plot plans and equipment layout Developed isometric drawings, general arrangement drawings and support detail drawings
I'm fetching it out of the database through a variable (i.e. $text
) and then parsing it through a javascript function function(text)
in order to post the text into a form textarea field for editing.
But when I click the button to run the function, it doesn't do anything. If the text is smaller it works fine. Is there any limit to the characters of a javascript variable?
PHP code:
<?
$var = mysql_fetch_row($query);
$text=$var['cool'];
echo "<a onclick=\"func($text)\">button</a>";
?>
<script>
function func(text) {
$('<div>cool: '+text+'</div>').fadeIn('slow').appendTo('.somediv');
}
</script>