Skip to content
Advertisement

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

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

Advertisement