G
Greg Scharlemann
The last time I tried to ask this question...Google Groups screwed up
my message and there was no subject (sorry for that - I know it's
annoying).
I'm trying to learn how to develop a plug-in that allows users to
display data from one site in a third party site, like Google Adwords
or the Digg counter for news stories. I took a look at Digg.com and
found the following:
It looks like digg is doing the following to show the number of "diggs"
for a story on your website. On my page I would have the following:
-----------------------------------------------
<script>
digg_url = 'http://www.mynewspage.com/mystory.php';
</script>
<script src="http://digg.com/api/diggthis.js"></script>
------------------------------------------------
diggthis.js looks like:
------------------------------------------------
(function(){
var u=typeof digg_url=='string'?digg_urlIGG_URL;
document.write("<iframe
src='http://www.digg.com/api/diggthis.php?u="+
escape(u)+"' height='80' width='52' frameborder='0'
scrolling='no'></iframe>");
})()
------------------------------------------------
A couple questions:
1. Why the extra paranthesis? Is that an attempt to throw people off?
2. How does this work: var u=typeof
digg_url=='string'?digg_urlIGG_URL;
Thanks for your insight!
my message and there was no subject (sorry for that - I know it's
annoying).
I'm trying to learn how to develop a plug-in that allows users to
display data from one site in a third party site, like Google Adwords
or the Digg counter for news stories. I took a look at Digg.com and
found the following:
It looks like digg is doing the following to show the number of "diggs"
for a story on your website. On my page I would have the following:
-----------------------------------------------
<script>
digg_url = 'http://www.mynewspage.com/mystory.php';
</script>
<script src="http://digg.com/api/diggthis.js"></script>
------------------------------------------------
diggthis.js looks like:
------------------------------------------------
(function(){
var u=typeof digg_url=='string'?digg_urlIGG_URL;
document.write("<iframe
src='http://www.digg.com/api/diggthis.php?u="+
escape(u)+"' height='80' width='52' frameborder='0'
scrolling='no'></iframe>");
})()
------------------------------------------------
A couple questions:
1. Why the extra paranthesis? Is that an attempt to throw people off?
2. How does this work: var u=typeof
digg_url=='string'?digg_urlIGG_URL;
Thanks for your insight!