Wrap multiple HTML strings in React mode

I'm building an entity highlighter so I can upload a text file, view the contents on the screen, then highlight words that are in an array. This is array is populated by the user when they manually highlight a selection e.g... const entities = ['John

Get JSON keys in order

I have the below in a file and read as var input = require("./mydata.json"); "User": { "properties": { "firstName": { "type": "string", "minLength": 1, "maxLength": 50 }, &quo

Use Html.DropDownList in javascript

I have a Razor page that allows users to add a variable amount of attendees to a meeting object. On the page, there is an "add attendee" button that inserts the textbox onto the page and increments the subscript so that the model binder can pick

Selecting the input value of a subclass

I want to use an if statement to select the value of a subclass in an image slider. If the input value is 'yes', it changes the text color. Javascript: $('document').ready(function(){ if $('.slide-active').find('.black').value = 'yes'){ $('.slide-tit

Cross browser compatibility HTML5 & amp; CSS3

This may not be a question related to programming but I am still asking this since I am banging my head a lot on this issue. I am finding a lot of HTML5 & CSS3 features useful for my website designing. But as usual (like all developers) I am confused

form submit browser compatibility

I am fairly new in programming. I use following code to submit a form: <form action="" method="post" class="label" id="form1"> <span id="sprytextfield1"> <label>Ονομα* <br /> <in

Why Promise.resolve (). Then () is delayed?

I don't understand why resoved Promise delay .then() argument call? example: var myPromise = Promise.resolve(); console.log(myPromise); myPromise.then(()=>console.log('a')); console.log('b'); console return: > Promise { <state>: "fulfille

Replace the svg element with the icon

Replace Circle Elements with Icons I am trying to make my SVG circle elements look like shopping carts. Is there a way to completely replace the definition of a circle element in svg so that it renders a certain icon ? I'd like <circle cx="280px&q

How to cache http in Angular until the settings have changed?

Is it possible to cache some http until parameters used in url change: app.factory('dataService', function ($http,$rootScope) { return { getData: function () { return $http.get(rest.getData + $rootScope.number + "/" + $rootScope.blb ).then(funct

React.js creates a loop through Array

I'm trying to display a Table of 10 Players. I get the data from via ajax and pass it as props to my Child. var CurrentGame = React.createClass({ // get game info loadGameData: function() { $.ajax({ url: '/example.json', dataType: 'json', success: fu

Date of formatting

I am on MVC. In my model i got a variable Datetime In my view I am trying to give this a format when the page loads. Control @Html.TextBoxFor(m => m.RequestedLaunchDate, new { @class = "dateselector", @style = "float:left;" }) my JS

Do something to table elements except for one

I would like to ask is there a simple way of doing something to array elements with exception of one specific element in javascript. Example: var myArray = [ 1, 2, 3, 4, 5, 6 ]; I wanna run method or something else on all array elements except on myA

How can I do this JavaScript Timer function properly?

I am trying to make a timer using JavaScript. The problem is, I can't get the timer to stop when it reaches 0. I have tried using return and if statements, but nothing seems to be working. Am I on the right track, or is there a better way to do this?

Disable bounce in Mobile Safari Webview using css / js?

I've been trying to find the answer to this question without success. I am programming some webpages for a webview in MobileSafari. I do not have access to the Objective-C to disable the functionality that way. I'd like to provide a smooth scrolling

jquery-1.4.1.min.js does not work

The code below works prefect in visual studio 2010 but doesnt work on visual studio 2008, if there any others exception that i miss out? what else i should check for in order to know what am i missing? Noted* i can only received alert(starting) but n

Array faster after removing the first element

After reading the recent smashing magazine article on optimisation, I ran some tests to see what would be the most effective way of "deleting" an element from the middle of one of my arrays. After running my own tests regarding splicing a value

Can not Compile TypeScript Files in Visual Studio 2012

I downloaded and installed TypeScript extension for VS 2012, I got my first sample compiles by manually dragging the ts file onto the tsc.exe file! because no other way to compile the file will work. I don't want to manually do this everytime I want

debugger; in the Chrome console

Open a page in Chrome, enter the JavaScript console, and type debugger;. Immediately we hit a breakpoint at line 2 of the following code: with ((window && window.console && window.console._commandLineAPI) || {}) { debugger; } Can anyone ma

Facebook 'like' button for facebook page but with reminder

I want to use the facebook like button for a facebook fan page, but with a callback function. So far I've only managed to get the callback function to work with a facebook app with the following code- <script src="http://connect.facebook.net/en_US

Relationships-first queries

I'm currently writing a CSS selector engine for server-side JS (have a look!). To have a solid foundation, I started using the tests of Qwery (an existing selector engine). There, I found a number of tests for "relationship-first queries". Appar

TypeError not caught when using a Javascript interface

I'm currently displaying a bunch of data to the user as HTML in a webview. I have some links below each entry that should call a method in my app when clicked. The Android WebView's javascript interface seems to be the best (only?) way of handling th

JavaScript issue dealing with different browsers

The problem that I'm having is that my code works fine in JavaScript but doesn't work correctly in Firefox or safari and wondering why. What I'm doing is I have a loop going through each element and depending on the variable inside a text box just wa

Competition Models in nodejs

Does anyone know what the memory and threading models are in nodejs? In particular, is ii++ atomic? Does it behave as if ii were volatile in Java 1.5, in Java 1.4, in C, or not at all?It is useful to understand how node and V8 interact. Node handles

reverse json javascript

Is there an inexpensive way to reverse: { "10": "..." "11": "...", "12": "...", "13": "...", "14": "...", } so that I get: { "14": "..."