Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API suggestion #47

Open
skorokithakis opened this issue Apr 30, 2013 · 2 comments
Open

API suggestion #47

skorokithakis opened this issue Apr 30, 2013 · 2 comments

Comments

@skorokithakis
Copy link

Why not optionally put the data in the div, like so?:

<div id="qrcode">This is my data.</div>

This would also fail gracefully and just display the data. The existing call for using the library would override this method.

@jeromeetienne
Copy link
Owner

this call seems pretty specific, so it may not be suitable in a library

why do you think such a call should be in the library and not in your application code ?

@skorokithakis
Copy link
Author

A few reasons:

  • It feels like a sane default.
  • The data to be displayed is in the QR code div, rather than separated in some (potentially static) JS file at worst, or at the bottom of my page at best.
  • It fails better if the client has JS disabled.

I see you've updated the API call to take an argument, I was going off the GitHub page. What I propose is, in addition to:

jquery('#qrcode').qrcode({width: 64,height: 64,text: "size doesn't matter"});

that the following syntax be also supported:

jquery('#qrcode').qrcode();

Width, height and text could be retrieved from the div (and width/height set in CSS), which is a cleaner separation and more in line with the spirit of HTML/CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants