Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encodeForHTMLAttribute #9

Open
ricmetal opened this issue Sep 2, 2013 · 1 comment
Open

encodeForHTMLAttribute #9

ricmetal opened this issue Sep 2, 2013 · 1 comment

Comments

@ricmetal
Copy link

ricmetal commented Sep 2, 2013

is there any problem with reverting the order of apostrophes:

title= ' " + $.encoder.encodeForHTMLAttribute(var) + " '
and
title= " ' + $.encoder.encodeForHTMLAttribute(var) + ' "

do they work interchangeably? i thought i saw the example with a different apostrophe order than the one i am using - in my case the order i have doesn't seem to work. the data being treated isnt even printed. it actually seems to break the line of code it is in, which is a simple elemnt creation, with the img's default attributes, src, alt and title.

using encodeForHTML allows the data to be printed, but the data is not treated correctly, as the single apostrophe in the data closes the attribute...

here is the code, ive interchanged the apostrophes but the result (fail) is the same..i dont know why. is the img title attribute not an attribute?

var imgBoxes = '';
                    for(var n = 0; n < items; n++){
                        imgBoxes += '<div id="imgBox' + parentArray[n][0] + '" class="image-box image-box-unselected"><img src="gallery/' + userId + '/exhibitions/' + parentArray[n][1] + '" title="" alt="' + ls_glob_img_alt + '"><div class="photo-icons"><img src="' + ls_glob_del_src + '" onclick="delPic_confirm(\'' + parentArray[n][0] + '\', \'manage\'); this.blur();" class="pointer del-photo-icon invisible ttip" alt="' + ls_glob_del_txt + '" title="' + $.encoder.encodeForHTMLAttribute(ls_glob_dpb_title) + '"> <img src="' + ls_glob_edit_src + '" id="epi' + parentArray[n][0] + '" class="pointer edit-photo-icon invisible ttip" alt="' + ls_glob_epd_title + '" title="' + ls_glob_edit_at + '"></div></div>';
                    }
                    $('#galleryScroller_div').append(imgBoxes);
@chrisisbeef
Copy link
Owner

@ricmetal - I am working on resurrecting this project a little, and going through these old issues. Can you confirm that this is still an open issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants