97 Answered Questions for the topic javascript

06/05/19

Why does closing a window in Indesign doesn't work?

I have a question concerning Indesign script. Why does it work, when you close a window like: submitButton.onClick = function(){ close(); } But when I try to execute a function afterwards... more

06/04/19

add property to object?

With Indesign scripting, why can't I add properties to an object? I get an error > Object does not support the property or method 'foo' items = b.items(b.layer("s_labels")); for (var i =... more

05/30/19

Simplest way to plot points randomly inside a circle?

I want to have random points plotted inside a circle, but I do not know how to limit the points to be inside the circle. Given a circle of a certain size and position, how would I go about... more

05/30/19

Javascript/canvas renderer for CAD/AutoCAD files?

Does anyone know if there's a parser for autocad/cad formatted files in javascript? Or perhaps something server side which can translate cad files to collada so that three.js (and some of the other... more

05/28/19

javascript slider weighted values?

I have a JavaScript slider that outputs a value between 0 and 1 depending on its position. I want to convert that value to a value on another scale between say 100 and 1000, but based on the... more

05/23/19

Which large websites use D3.js?

05/22/19

How would one create a triangle container for an image (x-browser)?

How would I create a DIV containing an IMG where the DIV cuts the image into a triangle, thereby displaying only part of the image though a triangle. So... ``` <div> <img... more

05/22/19

Javascript/canvas renderer for CAD/AutoCAD files?

Does anyone know if there's a parser for autocad/cad formatted files in javascript? Or perhaps something server side which can translate cad files to collada so that three.js (and some of the other... more

05/21/19

What are the benefits of react?

05/16/19

Does d3 use jQuery?

05/14/19

How to solve the issue of round number in JavaScript?

I am having an issue in which if I am entering 9 sixteen times and formatting it using `Math.round(9999999999999999)` and it is becoming `10000000000000000`. Oddly enough, when I run... more

05/08/19

calculate straight line declining?

i have asset (say vehicle) with value of 1000 in this year... var assetCurrentBookValue = 1000 vehicle will depreciate within 5 years... that means the value will become 0 in the next 5... more

05/06/19

Why does javascript accept commas in if statements?

I stumbled across some javascript syntax that seemed like it should produce a parse error of some kind but doesn't: if (true, true) {console.log('splendid')} else {console.log('horrid')} //... more

05/06/19

Remove items from one array if not in the second array?

I state that I have tried for a long time before writing this post. For an InDesign script, I'm working with two array of ListItems. Now I'm trying to remove the items of one array that aren't in... more

05/06/19

Why is JavaScript useful for front end developers?

05/05/19

Is there a javascript library for ppt simulation?

I do know that there're are many server side ppt simulation projects like Slide Show (S9). But is there a javascript library which handles this and with a fairly easy syntax? That would be more... more

04/24/19

represent a positive integer x as the sum of numbers each to the power k. For example, 25 = 3^2 + 4^2.

I need to write a function in Java which would represent a positive integer x as the sum of numbers each to the power k. For example, 25 = 3^2 + 4^2. So, once I feed 25 and 2 as arguments in it, I... more

04/20/19

Given a degree x, find the nearest degree in an array of degrees?

I have an array of degrees, [10, 90, 200, 280, 355] for a circle. I'm given a degree, let's say 1. How do I determine that 1 is closest to 355 degrees?

04/18/19

What is Babel JavaScript?

04/18/19

What is prop in react?

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.