Skip to content
Advertisement

Tag: jquery

Calling a method from an event handler

I have this code I am working on but every time I call init method I keep getting an error: this.addElement is not a function Is it because I can’t call methods from event handlers? Answer You should read this book, JavaScript: the Good Parts and visit the Crockenator’s web site here, crockford.com You can also read about the JavaScript

jQuery Youtube URL Validation with regex

I know there is plenty of question answered over here https://stackoverflow.com/questions/tagged/youtube+regex, but not able find a question similar to me. Any body has the JavaScript Regular expression for validating the YouTube VIDEO URL’s line below listed. Just want to know where such a URL can be possible — update 1– — update 2– This one worked almost fine, but failed

jQuery find not working

This is my HTML: And javascript: Doesn’t seem to do anything (read_more is set to display: none) any ideas? Answer Try this: $(document).ready(function(){ $(‘a.more’).click(function(){ $(this).parent().next().find(‘.read_more’).slideDown(); return false; }); }); Update: Here is the demo 🙂 Code: You could also do: Or this:

How can I tell when changes to jquery html() have finished?

I’m using jQuery to change the HTML of a tag, and the new HTML can be a very long string. $(“#divToChange”).html(newHTML); I then want to select elements created in the new HTML, but if I put the code immediately following the above line it seems to create a race condition with a long string where the changes that html() is

Advertisement