Skip to content
Advertisement

Tag: javascript

Why do results vary based on curly brace placement?

Why do the code snippets below, taken from this article, produce different results due to only a single change in the placement of curly braces? When the opening curly brace { is on a new line, test() returns undefined, and “no – it broke: undefined” is displayed in the alert. When the brace is on the same line as return,

Get CSS path from Dom element

I got this function to get a cssPath : But i got something like this : html > body > div#div-id > div.site > div.clearfix > ul.choices > li But to be totally right, it should look like this :html > body > div#div-id > div.site:nth-child(1) > div.clearfix > ul.choices > li:nth-child(5) Did someone have any idea to implement it

HTML Templates in Javascript? Without coding in the page?

I am a web guy doing mostly Perl server-side stuff, and I’m slowly coming to a few conclusions. It is far better to do most of your code via Javascript and toss data back and forth via AJAX than it is to hit submit and reload a mostly-identical page I like jQuery because I like CSS, and it’s fun to

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.

how to alert javascript object [duplicate]

This question already has answers here: How can I display a JavaScript object? (40 answers) Closed 2 months ago. I am trying to study the jquery class, but I have a hard time debugging an object because I can’t see the element inside of it it returns [object Object].. 🙁 My question is how can I alert the object so

Javascript comment stripper [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 4 years ago. Improve this question I’m looking for some tool to remove cooments from Javascript sources.

Description Box using “onmouseover”

I am playing with the onmouseover event in javascript I would like a little box to pop up and remain up until there is no onmouseover anymore I think it’s called a description box, but I am not sure. How do I get a little box to pop up with custom text when I put my mouse over certain text,

Firing DOM mouse events programmatically from JavaScript

Is it possible to programmatically fire mouse events in DOM? My sample case would be the following: Whenever the user clicks the div over an iframe, I would like to somehow propagate the event to the iframe, too. (Here we assume that the iframe src is in the same domain.) Answer Whilst you can inject events into browsers’ event-handling systems

Getting HTML form values

How can I get the value of an HTML form to pass to JavaScript? Is this correct? My script takes two arguments one from textbox, one from the dropdown box. Answer HTML: JS:

Advertisement