Skip to content
Advertisement

Save json string to client pc (using HTML5 API)

I read few older thread about the same, but seen the file API changed a lot recently. My requirement is to save a json file (data is locally in indexdDB, but I need a way to back it up). Since I use indexdDB, I only target recent browsers, mainly chrome. So, it it possible to save data (json string) to

Three.js – Rotating a sphere around a certain axis

I have a problem. In Three.js, I want to rotate a sphere (Earth) around axis tilted by 23.5 degs. I found sphere.rotation.x, sphere.rotation.y and sphere.rotation.z, but when I combine them in the correct ratio, the sphere’s rotation is quite weird – it has no permanent rotation axis. I think I need a function like sphere.rotation.vector(1,0,-1). Does anyone know how this

No events for dynamically generated input tags

I have dynamically generated some input tags for a web application. The appended elements do not seem to have associated click, select etc.. events. I read you can you .on(). I would like to associate all possible events to all types of elements in a general way. What is the best way to go about this? Answer Suppose you want

Add class to li if content is a certain string

Would it be possible to add a certain class to a li that contains a certain string of text using JavaScript/jQuery? UPDATE/NEW QUESTION: Instead of detecting the content of the li, can I have it add the class if the li has another specified class? Answer Answering the fellow’s extended question: You’re asking really basic questions. I’d recommend you just

Can anyone explain me what is state and mutable data?

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. http://en.wikipedia.org/wiki/Functional_programming Can anyone explain me what is state and mutable data? Can anyone give me examples in either JAVA or JavaScript. Answer mutable suggest anything that can change, i.e. an int In java a string is

Creating a BLOB from a Base64 string in JavaScript

I have Base64-encoded binary data in a string: I would like to create a blob: URL containing this data and display it to the user: I haven’t been been able to figure out how to create the BLOB. In some cases I am able to avoid this by using a data: URL instead: However, in most cases the data: URLs

Advertisement