As some old versions of IE didn’t provide the event as argument to event listeners, we got used to (event||window.event). In order to decide whether it can still make some sense to have this in a modern library, I tried to look at what versions were concerned but I couldn’t find this information. So, what’s the most recent version of
Javascript – convert youtube/vimeo url’s into embed versions for use on a forum comment feature
Trying to make something similar to facebook. I’ve created this javascript url pattern converter. Something like this could be triggered just as the user clicks on the submit button for a forum post – convert url’s into embed html variants. Any ways to improve this? http://jsfiddle.net/88Ms2/377/ Answer LATEST CODE ******** http://jsfiddle.net/88Ms2/378/ This mimics the facebook post feature – of turning
Aren’t promises just callbacks?
I’ve been developing JavaScript for a few years and I don’t understand the fuss about promises at all. It seems like all I do is change: Which I could use a library like async for anyway, with something like: Which is more code and less readable. I didn’t gain anything here, it’s not suddenly magically ‘flat’ either. Not to mention
Google Form on Submit get values and format the time
I am using Google Apps Script with a Google form. When the user submits the Google Form I get a value from a question. I then take that value and make it a date object, from what I saw on this post about daylight savings I use that to determine the timezone. I run the date object through Utilities.formatDate and
moveend event fired many times when page is load with Leaflet
I need to do some operations when the map is paned or zoomed, so I attached a callback to the event moveend. It works fine, but when the page is load the event is fired three times and I don’t know why. Probably because during its creation the map is moved. To avoid this i tried to wait the load
Create an array with all numbers from min to max without a loop
I have two numbers, min and max, and I want to create an array that contains all number between them (including min and max). The most obvious approach is to use a for loop for this, and push the single values onto an array. Nevertheless, this seems to be a quite naive approach, i.e. it’s imperative programming. Now I was
Validation for 10 digit mobile number and focus input field on invalid
I need the code for validating email and mobile number in jQuery and also focus() on that particular field where validations are not satisfied. This is my query Answer for email validation, <input type=”email”> is enough.. for mobile no use pattern attribute for input as follows: you can check for more patterns on http://html5pattern.com. for focusing on field, you can
FormData is empty when using jQuery ajax()
I try to submit form with file with jQuery.ajax. Google says I should use FormData which will automagically encode the file and all inputs into the one object which I can send via XHR. Well, the FormData object is empty. It’s empty in the debugger and on the server side. I can’t find the error. Here is the code. The
Internet Advertisers and Third-Party Cookies – clarification?
I’ve read this question about how third party cookie are set , which is a subject I already know : it can be done via three ways : Script (application/javascript)mime type ( which is generated at server side) which can also set cookie. ( along with the script response). img link <IMG href=”http://www.advertiser.exmaple/add.cgi?source=example.com&user=1032354″> form submission to an iframe ( for
Can’t stop setInterval with clearInterval
Been playing with this in a fiddle for 4 hours now and cant find a solution… HTML: js: Note: because clearInterval is not working you need to click on “run” in the jsfiddle to get it to stop after clicking the checkbox, you have 7 seconds between alerts… Here is a link to the jsfiddle: http://jsfiddle.net/5udtC/5966/ Thanks! Answer Don’t redefine