Thread: Jquery problem
View Single Post
Old 08-23-2012, 12:06 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
You cannot just include line breaks inside a string literal. You'll have to escape them using the \ backslash character.

Code:
    $("#localUpload").append('    <div class="file_input_div">\
        <input id="fileName" class="file_input_textbox" placeholder="No File Selected..." readonly="readonly" />\
        <input type="button" value="Browse..." class="file_input_button" /> \
        <input type="file" name="image_upload[]" id="file_upload" class="file_input_hidden" onchange="javascript: this.form.fileName.value=((this.value.replace(/^.*[\/\\]/g, "")).split("..",2));" />\
    </div>\
');
devnull69 is offline   Reply With Quote