Forum Moderators: open

Message Too Old, No Replies

serving custom graphic to other sites

a la alexa traffic button

         

brickwall

11:23 am on Jun 4, 2006 (gmt 0)

10+ Year Member



i have an asp-based website that can supply dynamically generated data to other websites that may want to request it.

i want to serve this data embedded in a graphic much like alexa serves their traffic rank data via their graphical traffic button.

i can dynamically generate the graphic using a third party aspjpeg component. but i have no idea how to serve this graphic to each site using external javascript the way alexa does it.

can someone please walk me through the principle (and hopefully steps) required to accomplish this. or maybe provide a link to a resource where i can learn to do this. can't seem to find the right search phrase required to google such a tutorial.

====

alexa's snippet that embeds their traffic button:

<SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/t/b?url=www.targetwebsite.com'></SCRIPT>

paulanthony

11:40 am on Jun 4, 2006 (gmt 0)

10+ Year Member



Create an ASP script that outputs your button. Then your img tag looks like <img src="http://blah.com/script.asp"></img>

brickwall

1:47 pm on Jun 4, 2006 (gmt 0)

10+ Year Member



ok paul, i get what you mean.
that is a very direct and simple approach.

but may i ask, why do most sites providing this sort of functionality serve their graphic buttons via external javascript? is there an advantage to this? what am I missing if I serve my graphic button via this simple method that you outlined?

mrMister

6:32 pm on Jun 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



paulantony's method isn't any less simple. The javascript that some sites use allows them to add extra code apart from the image. A link to their homepage for example.

The disadvantage to the scripting method is that web browsers with javascript disabled won't load up the image. paulantony's suggestion will work on more browsers.

brickwall

10:58 am on Jun 5, 2006 (gmt 0)

10+ Year Member



i won't be needing to add anything else to that graphic image (apart from a link back to my site anchored on that image), so paul's method is sufficient for my purpose.

so the snippet I will be providing to interested webmasters will look something like this then:

<a href="http://mysite.com/targetpage.asp"><img src="http://mysite.com/generateimage.asp" width="XX" height="XX" alt="image description"></img></a>

is this really this simple?
am i not missing anything?

thanks guys.

mrMister

3:04 pm on Jun 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes it's that simple.

brickwall

3:08 pm on Jun 7, 2006 (gmt 0)

10+ Year Member



thanks MrMister and paulanthony.
iam going to try this now.

cheers.