如何使用客户端JavaScript制作动态Web徽章? [英] How does one get about making a dynamic web badge using client side javascript?
问题描述
例如,我们希望能够为我们的供应商提供javascript代码,并且一旦嵌入,它将在他们的网站上显示一个徽章并显示他们与我们开展业务已有多长时间.
For example we want to be able to give our vendors javascript code and once embedded, it would show a badge on their site and show how long they have been doing business with us.
谢谢
推荐答案
它不应该太难.
我建议提供带有包含其供应商ID的查询字符串的动态图像链接.然后,服务器将在其上显示带有其特定详细信息的徽章,例如
I recommend providing a link to an dynamic image with a querystring that contains their vendor id. The server would then render a badge with their specific details on it eg
<img src='http://www.x.com/vendor.gif.aspx?id=123' style='width:50px; height:50px'/>
这将使您更容易实现,并且使供应商更易于集成.它也适用于未启用JavaScript的用户.
This will be much easier for you to implement and much easier for the vendors to integrate. It will also work for users without JavaScript enabled.
这篇关于如何使用客户端JavaScript制作动态Web徽章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!