Html Entities/escape For Dynamic Url (ajax Updated Url)? April 22, 2024 Post a Comment var fb_ps_page = window.location.href; document.write('Solution 1: You are inserting into the URL context, so use proper URL encoding first:document.write('<iframesrc="//www.facebook.com/plugins/like.php?href=' + encodeURIComponent(fb_ps_page) + '&send=false&layout=button_count&width=450&show_faces=false&action=like&colorscheme=light&font&height=21&appId=205223179497882"scrolling="no"frameborder="0"style="border:none; overflow:hidden; width:450px; height:21px;"allowTransparency="true"></iframe>'); CopyAs encodeURIComponent does already encode the HTML special chars ", &, and < (/, #, and + too), you don’t need need to encode it for the HTML context any more. Share Post a Comment for "Html Entities/escape For Dynamic Url (ajax Updated Url)?"
Post a Comment for "Html Entities/escape For Dynamic Url (ajax Updated Url)?"