1. text

    Javascript, line breaks, single quotes

    If you are going to assign a string with line breaks into a variable with single quotes, because maybe it contains double quotes then at the end of each line before a line break escape it like the following code with an \

    <script>

    var new_html = ‘\

    <div id=”hello”>\

    <p>This is the new data</p>\

    </div>\

    ’;

    </script>

    This should help you with any issues you have.

About

My Name is Will Ayers aka cointilt and this is where I will be posting all of my small tips and findings that happen while I develope websites and web apps. I hope this will be a place to look back at for help when faced with a development issue.

I develop websites, co-own Motive Media and went to Full Sail University. I use html5 and php.

I love Codeigniter & jQuery

My Personal Blog

http://twitter.com/cointilt/

http://virb.com/cointilt/

http://readernaut.com/cointilt/

Search

People I follow