Skip to content

Author: admin@master

Enabling colors in term.js

I am using term.js for emulating a terminal in the web browser via JavaScript and Node.js. I have already setup the basic implementation and I can connect to both local as well as remote host (I use node ssh2 to connect to a remote host). Everything works as expected, except that it’s black and white (b…

Call multiple functions onClick ReactJS

I know in vanilla JavaScript, we can do: What would be the equivalent for making two function calls onClick in ReactJS? I know calling one function is like this: Answer Wrap your two+ function calls in another function/method. Here are a couple variants of that idea: 1) Separate method or with ES6 classes: 2)…

Bookmarklet in email

Is it possible to drag a bookmarklet from an email? Gmail doesn’t convert the raw javascript into a draggable link and will not attach javascript to image links. I tried several workarounds. I tried dragging a link then tried to redirect the header location with php. Putting JS in the header redirect is…

Using AngularJS for Ajax POST in Struts 1

I’m trying to send Ajax POST using Struts action form. I’ve succeeded to create this kind of call using jQuery. ActionForm: Action: jQuery Ajax POST (working): AngularJS Ajax POST (not working): for some reason AngularJS doesn’t like the way I’m sending the ActionForm data. Answer It i…

javascript fizzbuzz switch statement

I’m currently taking the code academy course on Javascript and I’m stuck on the FizzBuzz task. I need to count from 1-20 and if the number is divisible by 3 print fizz, by 5 print buzz, by both print fizzbuzz, else just print the number. I was able to do it with if/ else if statements, but I wante…