javascript

Finding the 'type' of an input element

Hi I'd like to be able to find the type of something on the page using javascript. The problem is as follows: I need to check whether a specific area is a checkbox/radio button/ or text field. If its a checkbox or radio button it doesnt have a length(no strings in it) otherwise if its a textfield I need to check whether or not it con...

Is there a tool for converting JavaScript to CoffeeScript?

I'd love to use CoffeeScript, but converting all my JavaScript files doesn't seem like a task I should have to do by hand... ...

Search for input name

On my form, I store inputs in this way: <input name="tokens[0][A]"> <input name="tokens[1][B]"> <input name="tokens[2][A]"> etc. Is there a way, using javascript or jquery, to easily grab all the inputs with [A] as their final index? All I actually need to do is count the number of inputs with an [A] index. ...

Javascript smooth scroll on page load?

PHP example: http://davidwalsh.name/dw-content/onload-smooth-scroll.php?scrollto=c4 Scrolling to a #link within the current page is easy, but I'm trying to load a new page then scroll it down after it has loaded. Here's how my links are set up: <a href="page1.php#top">Page 1</a> <a href="page2.php#top">Page 2</a> <a href="page3.php#to...

how to drag & drop buttons on Iphone

Hello I am developing for Iphone by using Netbiscuits tool. I need to use drag & drop functionality on IPhone. I have found a javascript code which locates at Drag Drop Javascript Library for iPad & iPhone. However I am not able to use drag & drop functionality by usng javascript code which was given at the website. Have you ever added ...

new Image(), how to know if image 100% loaded or not?

Hello, I'm creating new image using img = new Image(); img.src = image_url; Then I'm assigning img.src to the img tag's src in DOM $("#my_img").attr("src", img.src); How can I know that img.src has 100% loaded? What is the best practice? img.complete seem to me little buggy in some browsers. So, in another words, I need to assign...

How to change Image & content using JavaScript?

I just have an HTML page with an image & Content. <table> <tr> <td height="240" valign="top" colspan="3"> <img id="image" class="newsimage" src="D:/Search/images/search.jpg" alt="search" height="120" width="50%"/> <div class="imageContect">image Content</div> </td> </tr> </table> Below it I have 2 links of previous & next. <a href="#...

Format the date using <f:convertDateTime> and display it in the <h:outputText>

I want to display something like "2010-10-20 by Mary" in the h:outputText. The date value is stored inside the MBean 's field called date1 while the user name is stored inside the MBean 's field called username. I use the following EL expression and UI control: <h:outputText value="#{MBean.date1} by #{MBean.username}"> <f:convertDa...

How do I set default text for description field on the enter bug page? Description will need to change on update of one of the custom fields.

I have done this using javascript for the edit bug page, where I used a change of the bug status to modify the default text. This was done by calling a javascript function onchange of the bug status. I am now trying to do a similar operation on the enter bug page, but I need the default text to change based on the issue type. As this is...

How to change focus out of iframe?

Got some code which loads an input box, and then below this is an iframe with a textarea... Problem is I want the focus to be on the input box when the page loads, but it always jumps to the textarea because the iframe loads second... How do I keep focus on the first element in the page? ...

embed JavaScript in XML compliant JSP files (JSPX)

Hello! I am using Spring Roo for my project. Spring Roo is using JSPX for round-tripping. How do I embed JavaScript in JSPX page, so it stays parsable? ...

How to show image randomly with fade-in fade-out using jquery?

This is HTML Code. <div id="Slogan"> <h1> <img src="img1.gif" /> <img src="img2.gif" /> <img src="img3.gif" /> <img src="img4.gif" /> <img src="img5.gif" /> </h1> </div> #slogan {float:left;position:relative;width:100%;} I want show all image randomly but one by one like slide show, with fade-in fade-out effect. How to do with jquery...

Java web app as desktop app, which frameworks should I choose?

Hi, I need to make a web app that I would be able to install as a desktop application on a client PC (database, jetty+war, firefox/chrome/sth portable). The application is a quite big search app (I MUST use Lucene). There are only few screens, some dependencies in search queue, etc. Now I need help in choosing correct components. A...

Why YUI.lang.extend implements Inheritance this way?

I'm reading YUI2.8.1 source code yahoo/yahoo.js. The YAHOO.lang.extend method is implemented this way http://github.com/yui/yui2/blob/master/build/yahoo/yahoo.js I don't understand why it creates another F function. IMHO, below code should also work(ignoring overrides part) function extend (subc, superc ) { if (!superc||!subc) { ...

Detecting flash clicks through jQuery

I only have very limited control over a flash application. The only thing I can do is modify some links in an XML that it reads from. I want to execute JS code based on the selected item in flash. I can link to something like: currentpage.html#some_anchor, but is there any way for me to detect the URL change from jQuery? ...

Pixel Color Values of image using Javascript

Hi wanted to get the list of pixel color values(RBG) from an image using Javascript so that i can get interesting colors from an image .can anyone help me on this issue please... thanks in advance ...

how to set all links in iframe to "google.com" by javascript or jQuery ?

how to set all links in iframe to "google.com" by javascript or jQuery ? ...

How to make a dijit.Dialog nonmodal

I want to make my dialogs non-modal, i.e.: When opening multiple dialogs, they could be closed in any order (modal dialogs can only be opened in the reverse order in which they were opened) Clicking a dialog puts it above the others I've been reading the dojo/dijit documentation and found nothing ...

How can I run this in HTML?

var theNewParagraph = document.createElement('p'); var theBoldBit = document.createElement('b'); var theBR = document.createElement('br'); theNewParagraph.setAttribute('title','The test paragraph'); var theText1 = document.createTextNode('This is a sample of some '); var theText2 = document.createTextNode('HTML y...

Display retailers in google maps

I have a list of retailers and their logos and what I wanted to do was display them on a google map. I suppose the purpose of it is to demonstrate the extend of our market reach. What I want to do is be able to add the markers, however when I click on them, I would want to replace the text in the speech bubble to my own text, and also i...