What is the best way to create an API of buttons (simple links) to be used on other websites?
-
The buttons will be created using an interactive JavaScript-based "button builder". These buttons are simply links to certain custom URLs. I need the buttons to have fixed design, a fixed link, a fixed image within the button and fixed text within the button as well. I am specifically asking to see what is the best way to keep the design intact? Should I inherit a CSS file or should it be in-lined? I want the button code to be as simple as possible (possibly only in HTML tag or a JavaScript tag - whichever is better). I want my users to be able to use this button on their own websites and blogs etc. I just want it to be a simple copy paste of a short code. Any suggestions are welcome. I want it to be extremely simple on the user end and possibly fast in terms of loading.
-
Answer:
Facebook use iframe for its Like button they save button configurations as parameters in url to generate the button. They also use in-lined CSS for button width... <iframe src="http//www.facebook.com/plugins/like.php?href=URL&send=false&layout=standard&width=450&show_faces=true&action=like&colorscheme=light&font&height=80&appId=506192749407991" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe> You may use https://github.com/premasagar/cleanslate it's like reset.css, but works on a container.
Aniss Bouraba at Quora Visit the source
Other answers
This solution is certainly not your simple answer, but the approach could be pretty useful if it was modernized. This was a 'Share This' type of button API internally referred to as "Yahoo! This". The page of docs is gone now, but it has been archived here: http://web.archive.org/web/20090306051048/http://publisher.yahoo.com/social_media_tools/ here is the JS: http://web.archive.org/web/20061205200715js_/http://sm.feeds.yahoo.com/Buttons/V2.0/yactions.js and http://web.archive.org/web/20110210053643/http://sm.feeds.yahoo.com/Buttons/V2.0/yactions_core1.3.3.js By adding the JS to your page you could then display any number of button types inline on the page with different but joined up designs and styles. It included buttons for emailing, bookmarking, rating, Adding to Calendar, and even Recording to TiVo.
Matt McAlister
Related Q & A:
- What is the best way to distribute an audio/video feed from a computer to TVs over existing indoor coax cable?Best solution by Audio-Video Production
- What is the best way to clean LEGO bricks?Best solution by bricks.stackexchange.com
- What is the best way to make UI for an Isometric game in Java?Best solution by Game Development
- What is the best way to learn how to build websites and web applications with Python?Best solution by Quora
- What is the best way to get back links to a website?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.