Inspired to extend DotNetNuke®, everyday.
How can I add a "Hugg This!" social bookmark?
http://www.hugg.com/node/4247
My tries so far have not worked. I realized later that I would have to create my own JavaScript. Here is what I have tried:
document.write("<form method=\"post\" action=\"http://www.hugg.com/files/huggthis/huggthis.php\">\n"); document.write("<input type=\"image\" src=\"http://www.hugg.com/files/huggthis/hugg_this.gif\""); document.write("<input type=\"hidden\" name=\"title\" value=\"" + document.title + "\" />"); document.write("<input type=\"hidden\" name=\"url\" value=\"" + document.location.href + "\" />"); document.write("</form>");
And also:
function showHugg() { var title = document.title; var url = document.location.href; document.write("<form method=\"post\" action=\"http://www.hugg.com/files/huggthis/huggthis.php\">\n"); document.write("<input type=\"image\" src=\"http://www.hugg.com/files/huggthis/hugg_this.gif\""); document.write("<input type=\"hidden\" name=\"title\" value=\"" + title + "\" />"); document.write("<input type=\"hidden\" name=\"url\" value=\"" + url + "\" />"); document.write("</form>"); } showHugg();
To now avail...
Never mind... I didn't read the second part of their instructions where there is an alternate method. I will post it when I am done.
Here is the end-result that works for "Hugg This!":
textHuggThis = (document.all) ? document.selection.createRange().text : document.getSelection();window.open('http://www.hugg.com/node/add/storylink?edit[title]='+document.title+'&edit[url]='+document.location.href+'&edit[body]='+textHuggThis);return false;
I changed the text variable name from their example (which you had to look at their HTML source for.