javascript

Catching tab key navigation

I want to catch which element is on focus when users use tab key to move their focus. For example, there is a form and users can use tab key to move forward to next form element. I'd like to know which element is the current on focus. Thanks, Paul ...

Editable Dropdown?

I have a php page with 4 text boxes, each need a "drop down" when the text boxes have the focus. Clicking the options would populate the (editable) text box(es) and close the drop down. The text boxes are of course part of html forms. How can I do this inline with javascript or ajax using minimal code? ...

Keep website theme the same.. cookies?

I think I will need to use javascript to do this so I put it here on stack overflow. So, I have two themes for my website, the only difference is that one is a solid colour (background), the other a repeated image, so I didn't make separate css files for them. I have two links in the navigation bar that change it (with javascript). In th...

A javascript recursion problem

I'm writing a js recursion function to find all ancestors of an element a user clicked on. my code is like this: /**a global variable.*/ var anc; function getAncestors(e){ var ele = e.target; var parentName = ele.parentNode.name; anc +=bracket(parentName); if (parentName.toLowerCase() == "undefined" ) return; else ge...

Handling onclick event if no GUI element was clicked

To make it more clear what I need to do, here is the structure of the search form / HTML page I am working with: --- |A| --- --------- --------- --------- | | | | | | | B | | B | | B | | | | | | | --------- --------- --------- -----------------------------...

same form data, different actions on two separate submit buttons

I have what is essentially a shopping cart that needs to have two separate checkout options. The first of which takes the user away from the site, but form data must be posted. How can I create two submit buttons that will send the same form data to their own separate page? ...

how do i submit data from HTML using jquery

The question might not be clear, so i will explain further. I saw some page like wordpress new post tag, they have something like [input] x tag | x tag | x tag or Facebook Notes when you post a image... the when you input a tag and press enter, a new tag is insert in to element in the page... I don't quite understand how can yo...

Looking for Wii compatible Javascript Flash mp3 player

I am looking for a flash mp3 player that will work within the Opera-based browser on the Wii. The player needs to be javascript enabled (support methods like play, stop etc.) The mp3 tracklist will be built dynamically using ajax on the same page as the player so it must trigger an event when a track finishes playing (or at least provid...

SurroundContents on a range spanning multiple tags (getRangeAt problem?)

I have a script that (I think) needs to use surroundContents to wrap the selection area. Doing so allows me to append something, and then reassign the range as the selection. I believe I've narrowed the problem down to a misuse of getRangeAt, but I'm not quite sure how to correct it. Here's the brief bit of code: function getRang...

How can I open a webpage and run a javascript function from a Java app

Hi, I would like to open a webpage and run a javascript function from within a java app. For example I would like to open the page www.mytestpage.com and run the following javascript code:document.getElementById("txtEmail").value="[email protected]";submit();void(0); This works in a browser...how can I do it programatically? Thanks! ...

Storing persistent data in browser

For my web application, I need to store form inputs spanning across multiple pages, until I finally process/manipulate them to produce some results (its mostly formatting the data entered and presenting it in some layout). The options I think I have are - Keep sending user's inputs to the server, store it there in some database, do the...

How do I open a webpage and run some javascript functions?

Hi I would like to open a page and then run some javascript functions. My problem is that once I open the window it stops running the code: javascript: location=("http://www.myTestPage.com/"); showForm(); document.getElementById("txtEmail").value="[email protected]"; submit(); ...

What is difference between .htc and .js file?

What is difference between .htc and .js file? Can we convert any .htc file to a .js file? The problem is if we use htc to make png fixes, then we add htc to css file using body { behavior: url("csshover3.htc"); } But this is not W3C valid, so want to convert the .htc to .js and then use as a js file to attach in so it will be W3C...

xsltprocessor debuging in Chrome

This code:: xslProcessor = new XSLTProcessor(); xslProcessor.importStylesheet(xsl); result = xslProcessor.transformToFragment(xml, document); works fine in Firefox, but result is null in Google Chrome. xsl and xml are both loaded from the network via XMLHTTPRequest, and show as Documents in the Chrome JS console. How can I get more i...

Detect when mouse leaves via top of page with jquery

This Jquery problem has been bugging me for a while now. I developed a script, with one function detecting when the mouse leaves via the top of the page. Here is the code: $(document).bind("mouseleave", function(e) { console.log(e.pageY); if (e.pageY <= 1) { now = new Date(); for (i...

Resuming session with an AJAX call

My app has a session timeout after 30 minutes. If the user has a "permanent login" feature activated, then on a subsequent HTTP request the server reads the "perm session" cookie and restores the session. However, if the user does not reload or navigate to another page after his session expired, but rather clicks on a button that retrie...

get id of a cell in a table inside a div (JS and HTML)

Hi I have a php script that draws a table subject to certain conditions. When the table is drawn it is inside a div called ‘window’ and the table is called ‘visi’ I then want to use the code below to get the id’s of each cell in the table. I can get the class name no problem but get absolutely nothing from the id. Can anyone give me an ...

YUI SimpleEditor not right layout

I've downloaded the YUI library for the nice SimpleEditor. When installed and created a simple test. It will not display right. this is how it should look like. http://developer.yahoo.com/yui/examples/editor/simple_editor.html and this is how it looks with my example: http://ms.robertcabri.nl/testing.php Here is the code of my testing...

[jquery] fadein / fadeout div on checkbox select / unselect

Hello, I am trying to bring up a menu when any of the checkbox is selected, as you can see in screenshot below, it shows the number of selections and the menu also disappears when none is select. I am able to bring up the menu with this code $("input[name='id[]']").focus(function(){ $("#menu").fadeIn(); }); However, i dont kno...

Hover using javascript

Hi all, Here's what I would like to do. I have 2 identical lists that I would like to have change color on hover of a specific item on both lists simultaneously. Example: List One List Item 1 List Item 2 List Item 3 List Two List Item 1 List Item 2 List Item 3 So if you were to hover over List One's first item it would highlight...