Skip to content
Advertisement

Tag: jquery

The best way to bind event on a cell element

I’ve a web page fulfilled by a JS script that creates a lot of HTML tables. Number of <table> created can vary between 1 and 1000 with 100 cells in each of it. My question is : how to bind efficiently the click on theses tables? Should I bind the click on each cell of the <table> or directly to

Fire a function on a element

I need to add a color picker to some input elements. I’m using: This works perfectly. The problem is that the page has a AJAX form, which – when submitted – will overwrite the previous form with a new one (new input fields etc). After that the colorPicker stops working. So how can I fire that function to the newly

Dynamic Ad script Replacing Page

I have an application that uses a mobile ad provider; the way ad provider works is that I make a request on the server side, the provider returns me the mark-up and I include that on my site. In order to make the load page faster (which is a requirement that I don’t control), I have an AJAX call to

How to generate sequence of numbers/chars in javascript?

Is there a way to generate sequence of characters or numbers in javascript? For example, I want to create array that contains eight 1s. I can do it with for loop, but wondering whether there is a jQuery library or javascript function that can do it for me? Answer You can make your own re-usable function I suppose, for your

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

What are the differences between JavaScript’s window.onload and jQuery’s $(document).ready() method? Answer The ready event occurs after the HTML document has been loaded, while the onload event occurs later, when all content (e.g. images) also has been loaded. The onload event is a standard event in the DOM, while the ready event is specific to jQuery. The purpose of the

How do I check if file exists in jQuery or pure JavaScript?

How do I check if a file on my server exists in jQuery or pure JavaScript? Answer With jQuery: EDIT: Here is the code for checking 404 status, without using jQuery Small changes and it could check for status HTTP status code 200 (success), instead. EDIT 2: Since sync XMLHttpRequest is deprecated, you can add a utility method like this

How to change the text of a label?

I have a radiobutton list and on click on the radio button item I have to change the text of its label. But for some reason it’s not working. Code is below: Answer ASP.Net automatically generates unique client IDs for server-side controls. Change it to In ASP.Net 4.0, you could also set the ClientIDMode property to Static instead.

Advertisement