which is best to use Fusionchart or Highcharts?

I am building a reporting solution. After a lot of research I have narrowed my choices down to two solutions: HighChart and FusionChart. Between these two, I am still not able to decide which I should buy. Does FusionChart support animated redrawing of the chart like HighCharts? Is flash performant with large data sets? FusionCharts […]

Custom template(transclusion without ng-content) for list component in Angular2

I have a list component which shows only names. list component should be able to take custom template which will be given by user. List Component import {Component } from ‘angular2/core’; @Component({ selector: ‘my-list’, template: `<p>This is List</p> <ul> <li *ngFor=”#i of data”><div class=’listItem’>{{i.name}}</div></li> </ul>` }) export class MyList implements OnInit{ data: Array<any> = [{name: […]

Is there any way to prevent people from making my web game available offline?

It’s not the type of game that really need a server to operate. I’m using javascript and html5 right now, and I cant think of a way to prevent the game from being rip off. Using obsfucator is useless, the game would still work offline. Implementing a validation scheme is not invincible either. Someone smart […]

Can curlies be omitted for try and/or catch blocks, as for if and else ones?

if (foo) { bar; } can be shortened to if(foo) bar; since it’s only one statement in the block. I’m wondering if the same applies to try/catch… I don’t like extra cruft in my code.

Why are javascript programs delivered in plain text?

Why was it decided to ship javascript programs in plain text? Was it to achieve performance enhancement or the authors never imagined that javascript will be used in much more complex applications and developers may want to protect the source code?

How do I force a leaflet map to reload all tiles including visible ones?

I’m working on a graphing web-app and I’ve decided that leaflet would make a decent graph view. I have it displaying (sort of) but I need a way to force it to update when the user enters a new formula to graph. I’m using JQuery as well, but that shouldn’t matter. Here is the relevant […]

Why does php insert backslash while replacing double quotes

I’m wondering why php adds a backslash when i remove double quotes. <input type=”text” name=”number” id=”number” /> <input type=”button” name=”button” id=”button” value=”Button” /> Say they user enters the value 5-1/2″ and i’m passing it to a processing page via jquery‘s .get method. $(‘#button’).click(function(){ $.get(‘determine.php?number=’+$(‘#number’).val(),function(data){ $(‘#response’).html(data); }); }); Here is my processing page. determine.php $number = […]

Is it possible to display superscript characters in the alert() dialog?

Is it possible to display superscripted characters (not only numbers) in the alert(), confirm() or prompt() dialogue boxes in JavaScript? Due to some reasons I need to insert a text: 2 followed by superscripted ‘n’ 2^n Into JavaScript alert, confirm and prompt boxes. Fast google searching did help but not exactly I found a way […]

Detecting user tampering with DOM

I’ve written a web app that uses an ad banner on the side to support free accounts. Problem is, since the ad is loaded in its own <div>, it’s relatively easy to go into developer/debug console in any modern browser and either remove the div or resize the ad to 0px using CSS overrides (the […]

Javascript .split() a string for each number of characters

I have a variable that holds a number var simpleNumber = 012345678; I want to .split() this number and create an array that would be of each 3 numbers the array should look like this [012, 345, 678] var splitedArray = simpleNumber.toString().split(/*how do i split this?*/); it is part of a getRGB(“ffffff”) function, so i […]