javascript

problem in javascript

Hi, problem in javascript validation , how to make call to javascript ? <!DOCTYPE html> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component"&gt; <html> <head> <script...

jquery autocomplete highlighting

How can I make my jquery autocomplete highlight what the user is typing in in any autocompleted results? The code I am using is: $("#keyword").autocomplete({ source: "ajax/autocomplete.php?action=keyword", minLength: 2 }); Tried this implemented from the link tomasz posted: $("#keyword").autocomplete({...

Get property of object in JavaScript

Basically I have a form with a <select> that chooses which set of data to use (values are "m", "f" and "c"). I then have a dictionary/object with the data in: var gdas = { // Male "m": { "calories": 2500, "protein": 55, "carbohydrates": 300, "sugars": 120, "fat": 95, "saturates": 3...

javascript detect # in url

My application is an iframe app so when the user changes page they do not automatically get taken to the top. To combat this on page load I call window.location.hash = 'tophash' I have found however on some rare cases I need to take the user to a specific part of the page. So I make a url with #anotherID on the end. Problem is curren...

jCarousel and Fancybox

Hi. On one of my content pages, I'm using the jCarousel and Fancybox JQuery plugins. The problem is that only one of them works at a time, so I think there must be a conflict. This is the code used: <script src="js/jquery.jcarousel.min.js"></script> <script> jQuery(document).ready(function() { jQuery('.showcase').jcarousel({ ...

How Do Google and Bing's Autocompletion Work?

How Do Google and Bing's Autocompletion Work? When I use firebug I see no XHR's. In that case, how is the data retrieved? ...

jquery.Event of dynamic elements.

my code and my problem is: <script type="text/javascript"> $(document).ready(function() { // this variable is used to set the dynamic elements tagFlag = ''; $("#a1").click(function(event) { event.preventDefault(); tagFlag = 'me'; // setting the element which I want to trigger later }); $('#'+tagFlag).click(funct...

Facebook Connect Bug - JavaScript Refresh

Facebook Connect has a recent bug that is causing the permissions pop-up window to not close and refresh the parent window as it is designed to do. Instead, after approval by the user it attempts to load the page directly in the pop-up window which is an awful user experience and really hurting our registrations. You can see the bug by r...

programatically highlight/select a "dl" item

the following test html creates a tabbed list (new, update, delete) on the row. the current test updates the data, via javascript/ajax calls, and so the tab selected by the user doesn't change, as the page isn't redisplayed/regenerated. however, if i change the test, to do a call back to the server, so the server has to redisplay the p...

how to use jquery UI autocomplete 1.8.4?

i want to display suggests like STREET NAME > CITY > COUNTRY (4 different varaibles street,city,country,url that i get in json from the server) and when i chose one it will go to url like a link and will highlight the letters that i type that found in the suggests how can i do it? here is my code <script type="text/javascript"> $('#...

How do you re-use javascript functions

We have lots of javascript functions, which are usually handled via the onclick function. Currently they are present in every file where-ever it is needed. Would it make sense to consolidate all javascript functions into a single file and use this where-ever it is needed? What is the general practice here <s:link view="/User...

asp.net jquery datepicker control with image?

I am looking for Jquery datepicker control like ajax calendar control with image button next to text box in asp.net. If any examples available please share with me. I saw this http://www.west-wind.com/weblog/posts/891888.aspx, but I donot custom control. ...

Debug a Webworker

What's the best way to debug a webworker? My worker appears to be failing somewhere, but I don't appear to be able to log things to the console to figure out what's going on. Is there a way using firebug, or webkit's inspector I can run javascript in the webworker context? Is there a better way of doing this? ...

Please, help me get $randomQ and $matchinA, then have jQuery refresh if $matchinA is typed?

Please, show me how to get a random question, '$randomQuestion'(i.e., "What color is the sky?"), and matching answer, $matchingAnswer, from the quizID section of my SQL database, and then use jQuery to refresh the form, only? I started by creating the form and some JavaScript that may work. FORM: <form name="$quizID" action="http://as...

Using Ant scriptfilter to count lines

I am trying to write an Ant <scriptfilter...> to change occurrences of the string "__LINE__" to the correct line number in Java source files. Does anyone have an example of using JavaScript (or some other embedded scripting language) to do this? In particular, how do I create a "global" variable that is initialized to 1 when the script ...

Check if user exists in database (form)

Hi, I have a script which allows users to sign up, which imports data into a MySQL table. user_availability.php http://pastebin.com/PSRndXbq number.js http://pastebin.com/iYAPuwN7 This script will tell the user if that number is present in the table. However it continually says its not in the table despite it being in there (looking...

Jquery: Set a timeout of a page for loading

Hi to all, i would like make a script that detect if the page is full loading in 30 or else refresh the page with method (CTRL + F5) of Firefox that clear the cache of that page and refresh.. Is possibile to make? P.S: If is not possibile to make in Jquery i can use normal javascript. Thanks in advance. Kind Regards. Luca. ...

How to use HTML Dom in adobe flex?

Can you use Html DOM in adobe flex to... 1) write/Auto fill in a form? 2) Read values in label? Textboxes? And use them in your program? ...

Issues Adding rows upon submit with Javascipt

Im trying create a form where when the "+" button is pressed a new row of four input blank boxes is created. Now when "+" is pressed it copies the row (and anything typed in it) identically. How can I create a blank row? How can I have only one "+" button rather than a new one on each new column? Heres the page>> http://myvirtualltcigu...

The dot after the integer number value in JavaScript?

In JavaScript it is valid to end an integer numeric literal with a dot, like so... x = 5.; What's the point of having this notation? Is there any reason to put the dot at the end, and if not, why is that notation allowed in the first place? UPDATE: Ok guys, since you mention floats and integers... We are talking about JavaScript here...