PhantomJS; click an element

PhantomJS; click an element

How do I click an element in PhantomJS?page.evaluate(function() { document.getElementById('idButtonSpan').click(); });This gives me an error "undefined is not a function..."If I instead return document.getElementById('idButtonSpan');an

Font scaling based on width of container

Font scaling based on width of container

I'm having a hard time getting my head around font scaling.I currently have this site with a body font-size of 100%. 100% of what though? This seems to compute out at 16px. I was under the impression that 100% would somehow refer to the siz

Why don't the AngularJS docs use a dot in the model directive?

Why don't the AngularJS docs use a dot in the model directive?

In the video AngularJS MTV Meetup: Best Practices (2012/12/11), Miško explains "..if you use ng-model there has to be a dot somewhere. If you don't have a dot, you're doing it wrong.."However, the very first example (The Basics) in the Angu

How can I format numbers as dollars currency string in JavaScript?

How can I format numbers as dollars currency string in JavaScript?

I would like to format a price in JavaScript.I'd like a function which takes a float as an argument and returns a string formatted like this:"$ 2,500.00"What's the best way to do this? 1:You can use: var profits=2489.8237 profits.toFix

How inject $stateProvider in angular application?

How inject $stateProvider in angular application?

I try to use angular-ui, and try to inject $stateProvider:html

jQuery fileupload not working in IE 8 and 9

jQuery fileupload not working in IE 8 and 9

This code works in FF and chrome. In IE 8 or 9 I get a 500 error saying a not null property is null.Here is the html Add Documents... Documents

How to use AngularJS 2 without npm and Node.js?

How to use AngularJS 2 without npm and Node.js?

The current versions of AngularJS 2 references always npm based configurations.Is it possible to manage a project of AngularJS 2 without npm?Is it possible to use AngularJS 2 in production statically without npm/Node.jsI already found answe

Bluetooth Low Energy API for Windows 7.0

Bluetooth Low Energy API for Windows 7.0

Windows 8 exposes an API to communicate to Bluetooth Low Energy (Smart) devices, but this API is not available in previous versions of Windows, so how can I communicate with a BLE dongle on Windows 7?The BLE dongle I'm currently using (BLED

Chrome dev tools pauses on exceptions in blackboxed script

Chrome dev tools pauses on exceptions in blackboxed script

I have a JavaScript file that I have blackboxed in the Chrome developer tools and I have the debugger set to pause on uncaught exceptions. However, the dev tools continues to pause on uncaught exceptions in the blackboxed JS file (see scre

Clearing require cache

Clearing require cache

I am trying to delete a module from cache as suggested here.In the documentation we read: require.cache Object Modules are cached in this object when they are required. By deleting a key value from this object, the next require w

Rewrite root address to a subdirectory in nginx

Rewrite root address to a subdirectory in nginx

I'm converting my mediawiki site to use nginx as a frontend for static files with apache on the backend for php. I've gotten everything working so far except for when I view the root directory "example.com" it tries to serve a directory lis

Bypass HTML “required” attribute when submitting [duplicate]

Bypass HTML “required” attribute when submitting [duplicate]

This question already has an answer here: Required attribute HTML5 8 answers I use required for a 1st check before submitting a form.Problem is, that I

jquery: how to include other .js-files into .js

jquery: how to include other .js-files into .js

Is there any jquery plugin (instead of incldeMany) or simple function to include js-files on demand ?for example:$.include('myscript.js'); ? 1:How about jQuery.getScript()? It's built in to jQuery and works like so:$.getScript('ajax/test

Error handling on request piping

Error handling on request piping

I wrote simple proxy on nodejs and it looks likevar request = require( 'request' );app.all( '/proxy/*', function( req, res ){ req.pipe( request({ url: config.backendUrl + req.params[0], qs: req.query, method: req.met

How to know in which file that defined a js global var in chrome console?

How to know in which file that defined a js global var in chrome console?

How to find out which file and line a variable was defined in using google chrome console?For example, the variable Native (from MooTools) has been defined in global scope. I want to know in which file that defined this variable using googl

$(…).on is not a function - jQuery Error

$(…).on is not a function - jQuery Error

I am using dialog box, which I am closing when a user click anywhere on page expect that dialog box.Here is my code:$('body').on('click','.ui-widget-overlay',function(){ $('#myRateSettingsPopup').dialog('close'); }); Somehow its returni

Load index.html every time from the server and NOT from cache

Load index.html every time from the server and NOT from cache

I have a webpage index.html hosted on a particular server. I have pointed example.com to example.com/index.html. So when I make changes in index.html and save it, and then try to open example.com, the changes are not reflected. Reason that

jQuery or JavaScript equivalent of PHP strpos function to find string on a page

jQuery or JavaScript equivalent of PHP strpos function to find string on a page

Is there an equivalent function in JavaScript or jQuery similar to strpos in PHP?I want to locate a string inside an element on a page. The string I'm looking for is: td class="SeparateColumn"I would like something where I can run it like t

How to get user agent in PHP

How to get user agent in PHP

I'm using this JS code to know what browser is user using for. And I want to get this navigator.appName to php code to use it like this:if ($appName == "Internet Explorer") { // blabla}How can I do it? 1:Use the native PHP $_SERVER['HT

Platform Independent Mobile Applications [closed]

Platform Independent Mobile Applications [closed]

How far can we think of Platform Independent Mobile Applications ? The idea behind this question was - To use less efforts for building the same application for different platforms like Android , iOS , Symbian.I had looked on some of the to

Synchronize video and audio (preferably without JavaScript)

Synchronize video and audio (preferably without JavaScript)

If I have HTML5 video and audio elements, is there a clean way to keep them in sync? They should act like a video file that contains an audio track, so advancing one track manually should bring the other one along with it. Let's say the two

node.js websocket crashes when client disconnect

node.js websocket crashes when client disconnect

I am very new to NodeJS and Websockets, but i am trying to play with it.What i do is read incoming datas from Serial port, then send these datas to a web page using websocket.From here everything works fine.I use node-static to serve my web

How to force an iFrame to reload once it loads

How to force an iFrame to reload once it loads

I have numerous iframes that load specific content on my pages. Both the parent and iframe are on the same domain. I have a scrollbar inside the iframe that doesn't seem to load correctly in all browsers. But when I refresh the iframe it lo

JQuery/JS Markdown plugin?

JQuery/JS Markdown plugin?

I'm writing a chat app, and I'd like to add some simple functionality where users use markup to affect text formatting, like bold or italics. I'm envisioning this would be like how it is done on Google Talk or StackOverflow. Does JQuery hav

How to get POST fields in Express, without using bodyParser middleware?

How to get POST fields in Express, without using bodyParser middleware?

With recent versions of Express, the recommendation (conveyed through a debug message) is to stop using the bodyParser middleware. I read a bit, and it looks like bodyParser is a wrapper to the json and urlencoded middlewares - and lo and b