jQuery add Share Icon script
- by Eddie Parker
Hello:
I'm trying to add via jQuery the share icon [1]. Unfortunately I can't seem to do this as jQuery appears to escape the script code and I can't seem to get it to work with .text() or .html().
Has anyone gotten this, or something similar, working?
The code I'm trying is:
var enc = $('<div/>')
.text('<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=faa9f152-cae0-4ff3-bab7-32ae934bc698&type=website&style=ro
;
$('<div/>')
.appendTo(nav)
.addClass('navItem')
.append(eval(enc))
;
[1] http://sharethis.com/