Skip to content
Advertisement

Tag: javascript

Convert javascript code to c code [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question Is there any way to convert C code to JavaScript and from JavaScript to C? I found V8 juice which

Convert json data to a html table [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. Closed 8 years

what is the [object Window]?

Google Translate, has some bookmark let for translate with 1 click, for example: This javascript code, opens the translator page in the current page (target=_self), but I want it opens a new window (tab) for translate. so changed to: My problem is here: when I run that code, it opens a new window for translate, and do it; but the

using javascript’s .insertBefore to insert item as last child

I so miss jQuery. I’m working on a project where I need to get my hands dirty with good ‘ol plain Javascript again. I have this scenario: Via javascript, I want to be able to insert a new node before or after any of those children. While javascript has an insertBefore, there is no insertAfter. Insert before would work fine

How to find the 2nd closest ancestor in jQuery?

My DOM looks something like this: When the used clicks on ‘Edit’, I want to change the outer <li> to <li class=”selected>. I tried something like this, but this is not working: Any help is appreciated. Answer Go up a parent: It wasn’t working because closest starts with the current element, and so if you call it on something that

How do I style HTML5 canvas text to be bold and/or italic?

I’m printing text to a canvas in a pretty straight forward way: But how can I change the text to bold, italic or both? Any suggestions to fix that simple example? Answer From the MDN documentation on CanvasRenderingContext2D.font: The CanvasRenderingContext2D.font property of the Canvas 2D API specifies the current text style to use when drawing text. This string uses the

Convert JS date time to MySQL datetime

Does anyone know how to convert JS dateTime to MySQL datetime? Also is there a way to add a specific number of minutes to JS datetime and then pass it to MySQL datetime? Answer or even shorter: Output: For more advanced use cases, including controlling the timezone, consider using http://momentjs.com/: For a lightweight alternative to momentjs, consider https://github.com/taylorhakes/fecha

Converting hexadecimal to float in JavaScript

I would like to convert a number in base 10 with fraction to a number in base 16. All is well there. Now I want to convert it back to decimal. But now I cannot write: As it doesn’t return the decimal part. And I cannot use parseFloat, since per MDC, the syntax of parseFloat is It wouldn’t have been

Advertisement