jquery - apostrophe problems with twitter share url -
so realized apostrophes gives "'"
,
i have js following:
$(document).ready(function () { $('#share_buttont@(number)').click(function () { var loc = $(this).attr('href'); window.open('http://twitter.com/share?url=' + loc + '&text=' + "@item.title. news via www.test.com" + '&', 'twitterwindow', 'height=450, width=550, top=' + ($(window).height() / 2 - 225) + ', left=' + $(window).width() / 2 + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0'); }); });
if @item.title
contains " 'flying' boat smash record? "
, text apostrophes ruins text inside twitter share box. apostrophes turns '
.
is there ways fix this, or need remove apostrophes on text? before js script triggers?
Comments
Post a Comment