All Questions

1397
votes
19answers
566963 views

Event binding on dynamically created elements?

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready...
1005
votes
13answers
629839 views

window.onload vs $(document).ready()

What are the differences between JavaScript's window.onload and jQuery's $(document).ready() method?
78
votes
15answers
18357 views

So what if custom HTML attributes aren't valid XHTML?

I know that is the reason some people don't approve of them, but does it really matter? I think that the power that they provide, in interacting with JavaScript and storing and sending information fr...
50
votes
1answers
13920 views

What is Unobtrusive Javascript in layman terms?

What is Unobtrusive Javascript in layman terms? An example would be nice to aid my understanding.
43
votes
4answers
57183 views

How to check browser for touchstart support using JS/jQuery?

In an attempt to follow best practices, we're trying to use the proper JavaScript/jQuery events according to what device you are using. For example, we're building a mobile site that has an tag that ...
27
votes
2answers
19529 views

Using Google Analytics asynchronous code from external JS file

I'm trying to add the asynchronous version of the Google Analytics tracking code to a website. I'd like to keep the JavaScript in a separate file, and call it from there. Here's what I've currently ...
13
votes
7answers
10469 views

Why inline JavaScript is bad?

It is always recommended to avoid inline Javascript codes by putting all codes in a JS file, which is included in all pages. I wonder, if this does not cause performance problem in heavy pages. For e...
21
votes
6answers
20335 views

MVC unobtrusive validation on checkbox not working

I'm trying to implement the code as mentioned in this post. In other words I'm trying to implement unobtrusive validation on a terms and conditions checkbox. If the user hasn't selected the checkbox...
69
votes
4answers
27505 views

Javascript: Module Pattern vs Constructor/Prototype pattern?

I would like to know if the module pattern or Constructor/protoType pattern is more applicable to my work. Basically I am using unobtrusive javascript -- the HTML document has a reference to the .js ...
24
votes
5answers
7818 views

Help, "this" is confusing me in JavaScript

Working with the JavaScript one of the confusing thing is when using this var x = { ele : 'test', init : function(){ alert(this.ele); } } However when dealing with multiple object and ...

Previous Next