Cannot load local office.js

As this answer suggested, I want to modify a little bit office.js.  So I copied the content of https://appsforoffice.microsoft.com/lib/1/hosted/office.js to local, such that https://localhost:3000/static/office.js shows well the content.  Then, I mak...

jQuery .search() to any string

I saw this code snippet:  $("ul li").text().search(new RegExp("sometext", "i"));   and wanted to know if this can be extended to any string?  I want to accomplish the following, but it dosen't work:  $("li").attr(&...

How to, so to speak, restart or close browser after every protractor -spec test

I am implementing Protractor test for a web app. I have done some google searching but I have come up with zip, I want to every spec that I create to close the browser after it has ran all of the test in that specific spec file and then continue on t...

Java equivalent of JavaScript's String.match()

What is the Java equivalent of JavaScript's String.match()  I need to get an array or a list of all matches  Example:  var str = 'The quick brown fox jumps over the lazy dog'; console.log(str.match(/e/gim));   gives  ["e", "e&...

Justifying Crockford claims

I have read Crockford's JavaScript: The Good Parts and have used his validator JSLint. I am sometimes left wondering the justification behind his recommendations. Below is a list of examples I want substantiated.     Why does JSLint signal an err...

Programmatically finding Chrome browser history

I am making a small Java application to show which URLs in Chrome that the user has visited the most. How would I access my browser history within Java?...

How do you make an image or button glow when you mouse over using javascript or jquery?

I want to add a glowing effect when I mouse over a button or image. How do I do this with javascript, jquery, or CSS? Here is an example of what I want it to look  http://www.flashuser.net/flash-menus/tutorial-flash-glow-buttons-menu.html  Can someon...

Plugin throwing TypeError after WordPress 4.5 update

I'm debugging a visual composer plugin that broke after I updated WordPress to 4.5 and I can't figure out why it is throwing a TypeError.  The error message in the console:  JQMIGRATE: Migrate is installed, version 1.4.0              load-scr...

php array loading into javascript

so I am a total php/javascript noob.  I'm trying load a full php array into a javascript array. I wrote this for Javascript:      var names = new Array(); for(var i = 0; i < 48; i++) {     names[i] = "<?php echo giveJS() ?>"; }...

Add/removing div block jQuery

I'm writing a script to add div block after clicking the add button. Everything is fine, however after adding second block that incrementing.   For example: After second clicking that adding 4 block overall 6.  After clicking the removing that is...

WebRTC for realtime scaling

I'm looking for a cheapo solution to realtime scaling for many users in 1 channel.  I'm using sockjs but scaling is pretty annoying when talking about really large numbers.  I'm thinking about using webrtc to decrease cost with p2p. Inste...

What are some JavaScript Unit Testing and Mocking Frameworks you have used? [closed]

My main JavaScript framework is jQuery so I would like my unit test and mocking frameworks to be compatible with that. I'd rather not have to introduce another JavaScript framework.  I am currently using QUnit for unit testing and Jack for mocki...

Scope of “this” in JavaScript

I have a JavaScript class that looks like this:  function SomeFunction() {     this.doSomething(function()     {         this.doSomethingElse();     });      this.doSomethingElse = function()     {      } }   This code throws an error because the sco...

How to do sequence maps so that each map waits for the previous in rxjs?

const source = Rx.Observable.from([1, 2, 3, 4, 5]); const example = source.map(val => { /* asynchronous logic here*/ })                       .map(val => { /* asynchronous logic here*/ });                       .map(val => { /* asynchronous...

Firebase Service worker not found while using GWT (404 Error)

I'd like to use the firebase cloud messaging service in my GWT webapplication, but I'm stuck with some problems. The application should be able to register the firebase service worker and connect to the service with it's specific token. T...

JQUERY Sorting an Array of Objects

I have an array that is holding a number of  objects.  Array:    var activeMembers=[];   The DIV objects in the above array look like as follows - each was added one at a time:   <div id="mary" class="chatmember 1011"></div&g...

rails render view onclick with javascript

I'm trying to create a view, where users can click on different buttons and render different content based on the buttons they click. I've tried getting this done with JS but can't really get it to work. I made a button in my view:  <d...

JQuery and Chrome Extension

I am trying to develop a test chrome extension to see how JQuery works with chrome extensions.  From the code provided I think it should change the background of the popup to yellow.  I have tried loading the jquery.js using a content script and usin...

Equivalent of “window[”functionName“](arguments)” in server-side

What is the equivalent code of window["functionName"](arguments) in NodeJS server-side?...

Javascript Running on JSFiddle but not on a webpage

Ok so I have a code that would show different forms based on dropdown selection Here's the fiddle to that..   Well its always giving me Test1 which means its not changing the div display, it's working on JSFiddle but not on the webpage..  and...

Convert string to sentence case in javascript

I want a string entered should be converted to sentence case in whatever case it is.   Like     hi all, this is derp. thank you all to answer my query.   be converted to     Hi all, this is derp. Thank you all to answer my query....

How to disable validators using the XSP.partialRefreshPost method?

I am using XSP.partialRefreshPost to trigger a partial refresh from client side Javascript. I would like to be able to do the partial refresh without triggering the validators (which is just a simple attribute on an ordinary input control).  I have f...

javascript: prototypes with callbacks and 'this'

I've create a prototype based class Person that opens a WebSocket connection and defines callback functions as prototype methods.  Because inside the callback this will refer to the WebSocket object I used another variable to hold on to the Perso...

Why does less than not work?

this seems very straightforward, but why does this comparison stop working?  if (nmax < num){         nmax = num;     }   I have this inside a loop, looking for the largest number.  The first number is 105, then 89, then 99. then a whole munch of...

Google Maps : Issue regarding marker icons and geocoding

I have created a jsp where i have converted the addresses into markers using geocoder class in google maps. Now the only problem i'm facing is that when i'm trying to change icon image for the marker, i'm only getting last icon for all th...

Loop through all descendants of a div - JS only

I've been using jQuery to do this:  $element.find("*").each(function() {     var $this = $(this);      $this.removeAttr("style width align");      if ($this.is("embed")) {         $element.append("<div class='vi...

Div Square, width size based on 100% height

I'm trying to make a responsive square with the width size based on the (100%) height of the element. I believe it's impossible using only CSS.  The square width should be equal to the height (100% of the large container. The large container...

Loading jQuery, Underscore and Backbone using RequireJS 2.0.1 and shim

I am experimenting a little bit with RequireJS 2.0.1. My goal is to load correctly jQuery, Underscore and Backbone. From the original RequireJS doc I discovered that the author J. Burke added (to this new release) a new config option called shim.  Th...

Get browser width using php

Is there a way to get the screen size through php? I have had a look on google, and found a way of doing it through javascript as follows:  PHP :    <?php    $width = "<script>sw=screen.width;</script>";     $height = "<...

Why not animated GIF instead of animated CSS sprites?

In recent trends I've seen people animating CSS sprites using JavaScript instead of using animated GIFs?  Ex:    http://www.google.com/doodles/eadweard-j-muybridges-182nd-birthday (in fact, Google used this technique in other Doodles too) https:/...