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 […]
JavaScript
JavaScript: Get current function name
getCallingFunctionName() is the important function here.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function getCallingFunctionName() { var re = /function (.*?)\(/ var s = getFunctionName.caller.toString(); var m = re.exec( s ) return m[1]; } function myCurrentFunction(){ var func_name = getCallingFunctionName(); alert(func_name); //displays "myCurrentFunction" } myCurrentFunction(); |
Source: Can I get the name of the currently running function in 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 […]
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.