javascript

how to split the numeric values from alphanumeric string value using javascript?

how to split the numeric values from alphanumeric string value using java script? for example, x = "example123"; from this i need 123 thanks. ...

How can I create an editable combo box in HTML/Javascript?

I need to let users select an item from a dropdown list, but also allow them to instead enter any text, even if it doesn't match an item in the list. How can I achieve this on a web page with HTML and Javascript? The select field doesn't let users enter text, and the input text field doesn't show the preferred alternatives. All items m...

javascript as response text

Hi, I have an Ajax function which will retrieve some RSS feed script from server. I put this responsetext in a div using: $("#divId").html(responsetext); I want to execute the script inside the response. Currently, the RSS feeds not showing in the div. Is there any way to do that ? thanks.. responsetext ------------- - <div class="...

jquery collapsible menu help - almost there, but need 2 levels deep collapsible too!

Hi, I've taken the accordion menu from http://www.i-marco.nl/weblog/ and have customised it to what I need. One problem I have though is that I have a couple of submenu items which are also collapsible. The code I have works fine in terms of collapsing the menu, but I can't get it to retract this menu when the parent element is clicked....

AJAX Div Retrieval every 60 seconds

Hello everyone! What I would like to do is retrieve the contents of a PHP file and insert it into a div every 60 seconds, basically refreshing the dynamic div. I've come up with the following code so far, however it doesn't seem to be working. The code is just like this, nothing extra, apart from the MYSQL login. PHP to grab: <?php ...

Using Jquery, call function on selection just once

Say i have a selection of textboxes like this; var arrayoftextboxes = $('.textbox1, .textbox2, .textbox3'); Is there a way I can call a function on each one in a simpler way than this? It only needs to be called once. arrayoftextboxes.each(function(i){foo(arrayoftextboxes[i]);}); I tried arrayoftextboxes.load(function(){foo(this)...

access javascript variable in java

function test(custId){ List<Account> list=accountDelegate.findAccountEntityByGroupId((long)%> custId<%)%>; <script> } Here my question is how to send custId to java method as parameter from Javascript? Where java method takes long argument. ...

JavaScript apparently waits for each AJAX call before sending another in a loop

Hello. Straight to the point: I have this javascript: for(item=1;item<5;item++) { xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET",'zzz.php', true); xmlhttp.send(); } And in PHP file something like this: usleep(5);die('ok'); Now the problem is javascript seems to be waiting for each ajax call to be completed before send...

jQuery: Traversing AJAX response in Chrome/Safari

I'm trying to traverse an AJAX response, which contains a remote web page (an HTML output). My goal is to iterate through the 'script', 'link', and 'title' elements of the remote page - load them if necessary, and embed its contents to the current page. Its working great in FF/IE, but for some reason - Chrome & Safari behaves differen...

JQuery : Add row after the third row of a table

Hello , I have a string as 'new row'.I have a table which as 5 rows.I want to add this string after the third row of my table.How i do this using jQuery or javasript. ...

jQuery, jCarousel

Hi, I'm having trouble setting up jCarousel correctly. It seems like it's finding an extra list element on the ul and at the end of the scroll it scrolls a little bit more. I cannot understand why. The html code is the following: <ul class="demo1"> <li><a href="http://www.youtube.com/watch?v=jfWPDGWP568"&gt;V...

jQuery, get table cell at specific index

Hello, I know that I can get first or last table cell (ex for last row) using jquery expression like below: first cell: $('#table tr:last td:first') or last cell: $('#table tr:last td:last') Can I get cell at specific index, for example index 2, using similliar expression: ex: $('#table tr:last td:[2]')... Regards. ...

Jquery ajax() error : "Uncaught Syntax error, unrecognized expression: %2Cacpitool%2Caide"

Hello, I have a error when i tried to send post data with ajax() method. I have a array with : acpitool aide I use encodeURIComponent() for passing the array with data: but the ajax method fail. Could you help me? Thanks Edit : This is the ajax call $.ajax({ url: 'AjaxSearch.php', dataType: 'json', data: param+"...

Jquery effect problem : How to detect if mouseover is triggered by scroll ?

Hello, I have another problem, and because the reply is to fast here i come back again !! I would like to use "key navigation" and for that, i use the keypress event with down/up key ) When my mouse is over a div (div who's contenaing a big table) and i pull the down key : i scroll to next td + change css style + remove the current s...

Javascript - dynamically add input fields

Hi Guys, I have a code to add input fields dynamically in js. But the problem is if i add 3 fields or more and then browse a file(if the input field is file), the value of the field selected disappears. Can any one help Heres my code Thanks in advance. :) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o...

iframe resizing with scrollheight in chrome/safari

I'm trying to resize (make bigger or smaller) an iframe based on it's contents. After a click on each page a method is called which does the resizing. In Chrome I can make the iframe bigger, but not smaller. document.body.scrollHeight is always the biggest value. So if one big page sets #iframe.height = '620px', and someone clicks on ...

javascript:anchor tag problem

function main(){ var delImage=document.createElement("img"); delImage.setAttribute("alt","Edit"); delImage.setAttribute("src","drop.png"); var position=newRow.rowIndex; var typeElem=document.createElement("a"); typeElem.setAttribute("name","delete"); typeElem.setAttribute("href","#"); typeElem.appendChild(delImage); typeElem.setAtt...

How to enable favorite song feature with ajax in ASP.NET MVC2?

Say, we have a list of songs we want to display. If the user is logged in, he can favorite a song in a list of songs. We want to accomplish this using ajax. So we have the usual Song repository up, from where we fetch (paginated) songs and push them to view. In the view, we have something like <% foreach (Song song in Model) { %> .....

What's the difference between FireBug's console.log() and console.debug() ?

A very simple code to illustrate the difference. var x = [0, 3, 1, 2]; console.debug('debug', x); console.log('log', x); // above display the same result x.splice(1, 2); // below display kind of a different result console.debug('debug', x); console.log('log', x); The javascript value is exactly the same but console.log() displays it...

How to replace invalid characters in XML using Javascript or PhP

Hi, Need help here for the following: Running PhP, javascript, MySQL, XML. 1) Retrieving file from MySQL and stored it onto XML file. 2) Use javascript function to load XML file (that stored those data). 3) It produces invalid characters in XML file. STEP 1 : Sample of the code in PhP -> Loading MySQL DB to store data onto XML fil...