Using jquery I am doing something like:
$("#someId").append("this is some text, go here.");
How can I insert a url like this safely? Is there an easier way to escape all those characters that will cause js to break?
Unless I'm mistaken by what you are asking, you could do something like
link = $('