Skip to content
Advertisement

Tag: jquery

How can I add action to just created object in JavaScript?

I have some strange problem with action adding to dynamically created objects. The thing is, when I am adding it, together with assigning action, the action is done automatically, not by pressing mouse button. Now, after some changes based on previous functions what I’ve achieved is totally not working action. Because whole source code is quite long I’ve posted it

Math.max and Math.min NaN on undefined entry

When passing values to the Math.max or Math.min function in JavaScript, they return the highest and lowest values from the input respectively. However, if a piece of data that is undefined is entered, e.g. The result returned is NaN. Is there a simply way to fix this using JS/jQuery? Answer I assume the undefined is actually some variable. You can

How to reload/refresh jQuery dataTable?

I am trying to implement functionality whereby clicking a button on the screen will cause my jQuery dataTable to refresh (as the server-side data source may have changed since the dataTable was created). Here’s what I have: But when I run this, it does nothing. What’s the proper way to refresh the dataTable when the button is clicked? Answer You

Jquery -> vanilla javascript?

I am programmer who learning jQuery javascript but never really grasped vanilla javascript (i know I am a naughty programmer). My question is how would I go about replicating this functionality in vanilla JS? Answer This site might help ! But here’s a step by step conversion:

Problems with window.postMessage on Chrome

I have been stuck on this for hours. I have a.html on http://example.com that contains an iframe with src to b.html on http://subdomain.example.com. a.html has some JS code to postMessage to the iframe. The code to postMessage is simple: But this way, Chrome throws an error: I have also tried: But NO LUCK! This is the ONLY WAY it works:

How to detect chrome and safari browser (webkit)

I am trying to detect the chrome and safari browser using jquery or javascript. I thought we are not supposed to use jQuery.browser. Are there any suggestions here? Thanks a lot! Answer If you dont want to use $.browser, take a look at case 1, otherwise maybe case 2 and 3 can help you just to get informed because it

Add/remove class with jquery based on vertical scroll?

So basically I’d like to remove the class from ‘header’ after the user scrolls down a little and add another class to change it’s look. Trying to figure out the simplest way of doing this but I can’t make it work. CSS HTML I’m sure I’m doing something very elementary wrong. Answer Fiddle Also, by removing the clearHeader class, you’re

Advertisement