Category Archives: Frameworks

Bootstrap and jQuery

I’ve been working with bootstrap and jQuery a little lately. While, it’s impressive what you can do just out of the box, it’s a little bit like the early days of javascript. There’s bootstrap, bootstrap-theme, and bootstrap-combined. Bootstrap’s own website says nothing of the “combined” version. Nobody explains what the “theme” version is for. A quick review of the docs fails to clarify that point.

While working up a basic website, I needed to have a modal dialog for user input. After googling a bit, I found this site: http://mode87.com/untame/demo/modalcontact/. The author uses the following these files:

  • assets/bootstrap.min.css
  • http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
  • assets/bootstrap.min.js

So the author is clearly working with a downloaded version of the files and those files have either been modified or contain code that isn’t in bootstrap files anymore. The animation works great, the dialog slides in and out of the window.

When I use the same code to run the example on my local server and use bootstrap files from the CDN, it doesn’t work for me. That reminded me of early days of javascript where some javascript code would work on 9 browsers out of 10 but would fail on the 10th one just for sake of it. That was using the same browser. The same code would work even more unpredictably on different browsers. Javascript engines have come quite a ways from those times, but some of these bootstrap/jQuery frameworks haven’t quite caught up. Or if they have, the authors don’t seem to be communicating/documenting stuff properly enough.

In the end, this is how I solved the modal form fading in and out stuff.

<!-- this is how to show the dialog -->
<span id="row-1" class="glyphicon glyphicon-arrow-down" 
  style="margin: 2px 10px 2px 10px;" 
  data-toggle="modal" data-target="#user-data"></span>

<!-- this is the modal dialog -->
<div id="user-data" class="modal fade">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header"><button class="close" type="button" data-dismiss="modal">×</button>
        <h4 class="modal-title">User Settings</h4>
      </div>

      <div class="modal-body">
        <div class="row">
          What you want here. Form Inputs, Data displays, etc.
        </div>
      </div>

      <div class="modal-footer"><button class="btn btn-default" type="button" data-dismiss="modal">Close</button></div>
    </div>
  </div>
</div>

You’ll need to add a <input type=”button”> tag and capture the onclick to respond to the OK hit and post back to the server or modify local UI elements.

JS Frameworks by the Dozens

Lately, there’s been a ton of JS frameworks/libraries coming out. AngularJS, React, Bootstrap, Meteor. There are templating frameworks such as Handlebar, Moustache. There are the simple libraries like jQuery, etc. etc. It’s getting a little ridiculous to think that any one of these framework wasn’t enough. All the extra work that goes into creating yet another framework can be put into extending one of the existing ones to include what it is missing. Yet it seems developers keep writing frameworks and then publish them. Immediately each new framework gets some followers who swear by it and a new community is born. This community will insult all others, claim to be superior, yet it fails to fill that void in other developers’ souls. And those developer in turn go out and write yet another framework.

This really has to stop. Each framework distances you from underlying core technologies and becomes a specialty that claims space on your resume. It also prevents other developers from being able to work on a given project if they’re not familiar with the framework in use. In some ways this is a created problem for which a framework has then been created. There is stuff like firebase, which is cool and at the same time not really needed. Somebody has created a javascript library and a bought a lot of backend servers and is using sockets/polls to deliver realtime events to your page. And you’re now paying 19.99/mo or whatever price they feel like charging. This should just be implemented in your own app without needing an outside app hosted on their server, etc. etc.

For a long time I was under the impression that I’m the only one who thinks this way. But now, I see there are others who feel this way, too.

http://bitworking.org/news/2014/05/zero_framework_manifesto