Vue.js promotes itself as a progressive framework, meaning that you can start small and use as little or as much as you need. I’ve been working on Vue.js projects at both ends, some full fledged projects using vuex, components, and vue-cli, and some projects which...
I started playing with vue.js and used vue-cli to scaffold a new project. It all worked well until I tried npm run build. Then I got the following error:
ERROR in build.js from UglifyJs
SyntaxError: Unexpected token punc «(», expected punc «:» [build.js:8643,6]
It took me a while...
Today I came across a weird bug on a client's wordpress site that broke Visual Composer. The Javascript console was reporting a a.poplight[href^=#] syntax err which seemed to indicate that popups were not working. Indeed, there was a section of the page with tabs that showed...
I recently created a form where one of the questions was asking for a specific code (specifically, a NAICS code). The problem was that there are almost 20,000 codes to choose from, so it was not practical to use a pulldown. I hit upon the...
Posted at 16:12h
in
javascript,
Programming
Here's a small bit of javascript that I use in my Sencha Touch projects to find a parent with an id that matches a string.
function findParentNodeRegex(regex, childObj) {
var testObj = childObj;
var count = 1;
while(!testObj.id.match(regex)) {
//console.log('My...
A simple script to detect when a checkbox is clicked. What you do with once you've detected the click is up to you.
<html>
<head>
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.3.2");
google.setOnLoadCallback(function() {
$('#agree').click( function() {
if($(this).attr('checked')){
...
I was trying to perform a redirect to generate a CSV file from within a Wordpress admin page using the wp_redirect( ) function, but the problem was that I would always get the dreaded "Cannot modify header information - headers already sent" message. This is...
I was trying to add a small delay into my form submission like so:
<form ...