Category: JavaScript

  • CSS / JavaScript: Twitter Bootstrap center modal vertically on mobile web view

    I’ve been working with modal boxes using Twitter Bootstrap. And the page I’m working on needs to be viewed in mobile devices. The modal looks nice and centered when viewed on desktop, but when run in mobile web browsers, it’s aligned to the top.

    Someone on StackOverflow suggested the use of a helper div plus some custom CSS to align Bootstrap modals vertically.

    Code for modal:

    CSS:

    Source: Vertically centering Bootstrap modal window

  • JavaScript: Get current function name

    getCallingFunctionName() is the important function here.

    Source: Can I get the name of the currently running function in JavaScript?

  • How to make a basic “Login via Facebook” with PHP & JavaScript

    How to make a basic “Login via Facebook” with PHP & JavaScript

    You’ve seen how some popular websites let you register or login via Facebook — Pinterest, Vimeo, Lifehacker, and many more.

    In this blog post, I’ll show you the very basic setup of the Facebook login button for your website. It is up to you to enhance the functions of your registration system.

    Note: There are periodic updates to the Facebook API, sometimes resulting to issues with previously working implementations of the API. So please note that this tutorial was written in the third week August 2015. 🙂

    I began writing this tutorial late in August, but because of other projects, was able to publish it when it’s already September.

    (more…)

  • JavaScript: Setting the selected dropdown option by its index number

    Long time no new entry. 🙂 Internship is keeping me very busy. In this blog entry I’ll show you how to select a drop down option by specifying its index number.
    (more…)