I tend to use the image solution described by 24Ways to use ajax and scripts.
However, The ajax results are out of my control and I need a regexp to escape the quotes (' and ") since the scripts will house in an onload attribute.
This is my work so far:
clean_txt = clean_txt.replace(
/<script[^>]*>([\n\s\S]+?)<\/script>/img,
"<img src='1px.gif?d=$1' alt='' onload='new Function(\"$1\")();' />"
);
Does anyone have the final regexp, e g to escape the quotes in $1?