/* OK */ popURL('blah.com'); /* Invalid */ popURL('broken.com/ cant/have/embedded/real/newline'); #### # 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;