# before inserting a perl string into a quoted javascript # widget we always need to do at least this: # remove newlines and carriage returns my $embed_string =~ s/[\n\r]//g; # escape single quote chars - another gotcha my $embed_string =~ s/'/\\'/g;