I’m using the scrollTo jQuery plugin and would like to know if it is somehow possible to temporarily disable scrolling on the window element through Javascript? The reason I’d like to disable scrolling is that when you scroll while scrollTo is animating, it gets really ugly 😉 Of course, I could do a $(“body”).css(“overflow”, “hidden”); and then put it back
How to return void in JsDoc?
Is there a specified way to declare a method or a function to return void in JsDoc? Currently I am in the belief that void is the default return value, and other return values must be specifically provided: Answer I don’t believe you have to choose from a set of types in JsDoc… you can use any type name you
How to print text from textarea?
I want to print text from text area. I have a textarea which text can be updated by user. When user update text from textarea and then print the updated text can be print on page. And this text can be print on print page without textarea. Please suggest any solution. Thanks Answer I think I got what you are
Javascript adding zeros to the beginning of a string (max length 4 chars)
should be left alone. should be changed to “0120”; should be changed to “0010”; should be changed to “0007”; Answer
How to change value of object which is inside an array using JavaScript or jQuery?
The code below comes from jQuery UI Autocomplete: For example, I want to change the desc value of jquery-ui. How can I do that? Additionally, is there a faster way to get the data? I mean give the object a name to fetch its data, just like the object inside an array? So it would be something like jquery-ui.jquery-ui.desc =
How can I add “href” attribute to a link dynamically using JavaScript?
How can I add the href attribute to a link dynamically using JavaScript? I basically want to add a href attribute to <a></a> dynamically (i.e. when the user clicks on specific image in the website). So from: I need to go to: Answer
ASCII code generation for the combination of keys
I want to know how to get the ASCII code for the combination of keys. Like I want to handle event for some unique key combination [alt+ctrl+shift]. Alternatively can you please tell me the ASCII code for [alt+Enter], [ctrl+Enter]. Answer There are flags on the event object that tell you if the alt, control or shift keys have been entered:
JavaScript: Split array into individual variables
Considering this data structure: Looping through each vehicles item, is there a way to reassign the array elements to individual variables all in one shot, something like: … I’m trying to get away from doing: Just curious since this type of thing is available in other programming languages. Thanks! Answer Now it is possible using ES6’s Array Destructuring. As from
Is there a way to get the current function from within the current function?
Sorry for the really weird title, but here’s what I’m trying to do: As you can see, I would like to access the current function from within an anonymous function. Is this possible? Answer Yes – arguments.callee is the current function. NOTE: This is deprecated in ECMAScript 5, and may cause a performance hit for tail-call recursion and the like.
How do I remove tinyMCE and then re-add it?
I am trying to add the tinyMCE editor to my page, remove it, then add it again but am getting errors. When I run Part A, then Part B, Than Part A again I get the error: Part A Part B Edit: Below is the full JavaScript function. The first time through it opens the dialog and works, the contents