SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
Thread: Editing the **** script
-
Jul 19, 2007, 07:26 #1
- Join Date
- Oct 2006
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Editing the **** script
Hi,
I'm hoping someone can help me with this. I'm trying to integrate the **** button on my site using this code:
Code:<script type="text/javascript"> ****_url = 'URL'; ****_bgcolor = '#efefef'; ****_skin = 'compact'; </script> <script src="http://****.com/tools/diggthis.js" type="text/javascript"></script>
Code:<SCRIPT LANGUAGE="JavaScript"> <!-- { document.write(location.href); } // --> </SCRIPT>
I'd appreciate any help.
Thanks.
-
Jul 19, 2007, 07:35 #2
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Isn't the URL supposed to be the URL of the current page? In that case, it should be
Code:****_url = window.location.href;
-
Jul 19, 2007, 08:58 #3
- Join Date
- Oct 2006
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oops, sorry, I pasted the question from another forum and didn't think about the name.
Thanks for the reply, I didn't think it would be that easy. Is there anyway I could also include the url string within a link?
For example href="awebsitehere.com/submit?url=URL&title=The+Article+Title"
I'm not sure if the title in the link is also possible, but I thought I'd leave it in just in case.
Thanks again for any more help.
-
Jul 19, 2007, 09:08 #4
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Code:****_url = 'awebsitehere.com/submit?url=' + window.location.href + '&title=' + document.title;
-
Jul 19, 2007, 10:03 #5
- Join Date
- May 2005
- Location
- Singapore
- Posts
- 1,261
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just being curious here....why is the name **** censored?
Winners Respond. Losers React.
Singapore Web Designer
-
Jul 19, 2007, 11:22 #6
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Apparently **** asked for it after they received too much free advertising. I think they're afraid we would discuss them and portray them in a negative light or something of the sort. I'm not sure though, search the forums and I'm sure you'll find the reason.
-
Jul 20, 2007, 06:24 #7
- Join Date
- Oct 2006
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jul 20, 2007, 06:41 #8
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Wait, I thought this was for Dígg? What exactly are you trying to do? Do you want to create a link with that href attribute somewhere on your page? I thought that's what this was doing:
Code:<script src="http://****.com/tools/diggthis.js" type="text/javascript"></script>
Code:http://www.stumbleupon.com/submit?url=' + window.location.href + '&title=' + 'document.title
-
Jul 20, 2007, 08:14 #9
- Join Date
- Oct 2006
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The **** button works great now (thanks for the help) and wanted to also sort out the stumbleupon link to get that to work, so **** is a script and the stumleupon is just a link that needs editing and doesn't come as a script so that's why I wasn't sure how to adapt it.
-
Jul 20, 2007, 09:11 #10
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Ah I see. What you need to do is give the link an ID, as follows:
HTML Code:<a href="http://www.stumbleupon.com/submit" id="stumblesubmit">Submit to StumbleUpon</a>
Code:function stumblelink() { document.getElementById('stumblesubmit').href += '?url=' + window.location.href + '&title=' + document.title; } if (window.addEventListener) window.addEventListener('load', stumblelink, false); else if (window.attachEvent) window.attachEvent('onload', stumblelink);
If javascript is unavailable, the user will just be taken to the stumbleupon submit form.
-
Jul 20, 2007, 13:38 #11
- Join Date
- Oct 2006
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ah, great, thanks Raffle.
Thanks again for your help (and your patience!), I'm completely useless at coding so that's helped a great deal.
Bookmarks