English 中文(简体)
How to create a web widget for my website users to insert on their blog?
原标题:

For my wishlist site, I would like to propose widgets to my users in order to publish their wishlist on their blog or personal website. The idea is to propose a few lines of code to my users that they only need to copy/paste to insert the widget displaying their wishlist.

What is the best way to create/develop a widget ?

  • I have a RSS feed for each wishlist
  • Since the code need to be dynamic, I prefer not to use service like WidgetBox
  • Flash ? iFrame ?
  • Possibility to use jQuery

Thanks for your input...

问题回答

Definitely not flash [throws up]

What about using JavaScript? I am reminded of the Twitter Lists Widget that uses a bit of JavaScript to return the data and paint the HTML on the screen.

This is how Twitter does it:

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type:  list ,
  rpp: 30,
  interval: 6000,
  title:  Everything we do at ,
  subject:  the twoffice ,
  width: 250,
  height: 300,
  theme: {
    shell: {
      background:  #ff96e7 ,
      color:  #ffffff 
    },
    tweets: {
      background:  #ffffff ,
      color:  #444444 ,
      links:  #b740c2 
    }
  },
  features: {
    scrollbar: true,
    loop: false,
    live: true,
    hashtags: true,
    timestamp: true,
    avatars: true,
    behavior:  all 
  }
}).render().setList( ilmv ,  web-geeks ).start();
</script>

Obviously you may not need to use as many options, but a username field would certainly be helpful. It would be very easy to generate your users code, and you might even be able to make use of your RSS feed for this.

No reason not to use Flash, depending on what exactly you want to do. There are more or less universally accepted embed codes (see youtube s, for instance) that will allow a user to copy-and-paste the widget into their own website, pulling content from your server. You will retain control over the content of the widget, too, so if you want to re-style it or make a copy change then you can do that on your end and be confident that no matter where it s embedded the change will take effect.

AS3 is very powerful and allows you to do basically anything you want. The one trade-off here is that Flash doesn t display on iPhones as of right now. That will probably change in the future, but probably not in the immediate future.

If you re using RSS to manage the data you re in luck because Flash s native E4X parser will let you work with that data easily and use it as a model for whatever you want to build. If I were doing something like this I d use Flash without a second thought, but in fairness I am a professional AS3 developer.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签