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.
Tag: javascript
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
Extracting single frames from an animated GIF to canvas
I need to load all the frames of an animated GIF to an HTML5 canvas. Please note, I don’t want to “play” the animated (someone asked this before), all I want is to extract all the frames to use them as single images. Answer Sorry, the short answer is that JavaScript has no way of controlling the current frame of
Javascript arrays of Objects; Subtract one from another
Put simply, I want to subtract one array from another. The arrays are arrays of objects. I understand I can cycle through one array and on each item, comparing values in the other array, but that just seems a little messy. Thanks for the help, hopefully this question isnt too basic, I have tried googling it with no luck 🙁
How to check if the URL contains a given string?
How could I do something like this: Answer You need add href property and check indexOf instead of contains
set option “selected” attribute from dynamic created option
I have a dynamically created select option using a javascript function. the select object is when the js function is executed, the “country” object is and displaying “Indonesia” as default selected option. note : there is no selected=”selected” attribute in that option. then I need to set selected=”selected” attribute to “Indonesia”, and I use this using firebug, I can see
Can You Find Something Mod 2Pi in JavaScript?
EDIT: I have an angle from using Math.atan2() which I then want to add or subtract values from. However, this addition and subtraction sometimes means the angle is greater that pi or less than -pi and I’m looking for a way to get one of these outside angles back into the correct range. I’m trying to find a value mod
Using numeric values to select item from a dropdown box with JavaScript
I have a multitude of dropdown boxes within my web page. One of these dropdown boxes is used for a single selected value out of a list of options. How can I add an event to this section, so when it is in focus, I could use numeric keys like 1,2.. to select an option instead of using the mouse
How to get notified about changes of the history via history.pushState?
So now that HTML5 introduces history.pushState to change the browsers history, websites start using this in combination with Ajax instead of changing the fragment identifier of the URL. Sadly that means that those calls cannot be detect anymore by onhashchange. My question is: Is there a reliable way (hack? ;)) to detect when a website uses history.pushState? The specification does
How to convert a byte array into an image?
Using Javascript, I’m making an AJAX call to a WCF service, and it is returning a byte array. How can I convert that to an image and display it on the web page? Answer I realize this is an old thread, but I managed to do this through an AJAX call on a web service and thought I’d share… I