GithubHelp home page GithubHelp logo

giannisdag / smsapi-counter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smsapicom/smsapi-counter

0.0 2.0 0.0 8 KB

Script that helps to count number of characters in message and how many parts SMS will contain.

License: Apache License 2.0

HTML 17.89% JavaScript 82.11%

smsapi-counter's Introduction

Script that helps to count number of characters in message and how many parts SMS will contain.

Usage

You should add smsapi-counter.js or smsapi-counter.min.js files at the end of <body> element. You can find an example in demo.html file.

HTML

Activate counter with specified attributes. You have to target <textarea> and one random element (spanh1h2 etc) to show current characters count. With HTML you can activate one counter per page. To include more text areas with counters, use JavaScript activation method.

    <textarea data-cv-sms-textarea></textarea>
    <span data-cv-sms-counter></span>

Javascript

After loading smsapi-counter JavaScript file, use this method. You have to specify two parameters: ID of <textarea>, and ID of label that will show current characters count.

    CVSMSCounter.activate('textareaID', 'counterLabelID');

WARNING!

We reccomend to use UTF-8 encoding. Script might count characters wrong if you will use wrong encoding or message is filled using copy/paste method. If you want to protect additionally you can use parameters like nounicode, normalizemax_parts. You can find more details about parameters in SMSAPI.com specification.

smsapi-counter's People

Contributors

smsapi avatar smsapicom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.