본문 바로가기

프로그래밍/자바스크립트

익스플로러에서 트위터 공유하기 할때 한글 문제


function SNSScrap(){


htmlenct = htmlenct = encodeURIComponent("맞춤형 산후관리서비스 마더앤베이비 수원·동작·관악·금천지사 오픈이벤트");

htmlencu = encodeURIComponent("http://me2.do/5FLhYmYv");



gourl="http://twitter.com/home?status="+ htmlenct + " " + htmlencu;

window.open(gourl);

}


//한글 인코딩 문제로 그냥 한글로 링크보내면 400에러남

한글 인코딩해서 보내면 문제없이 잘됨



밑에 태그에 온클릭으로 붙여주기


예) <area shape="rect" coords="229,2054,303,2127" onclick="SNSScrap();" href="#" target="_self" />