javascript

Text box loses focus when DIV is hovered

Hello. I have a problem: When I enter a text into suggestion text box, popup panel appears. But when user places mouse over this popup panel with suggestions - text box loses focus. What should I do to prevent losing focus ? Example which have the same behaviour: http://demo.raibledesigns.com/gwt-autocomplete/ Thanks for any help. U...

I have to do two seemingly mutually exclusive things on leaving an asp:textbox. Please help me get some clairity.

This project has gone from being a simple '99 Ford F-150 to the Homer. I've got controls with a gridview with textboxes for data entry. All the user controls on the pages are in AJAX updatepanels. User types in a database column or budget entity or some other financial thing they want to include in the report. The textboxes in the ...

Using cellUpdateEvent with YUI DataTable and JSON DataSource

I'm working with a UI that has a (YUI2) JSON DataSource that's being used to populate a DataTable. What I would like to do is, when a value in the table gets updated, perform a simple animation on the cell whose value changed. Here are some relevant snippets of code: var columns = [ {key: 'foo'}, {key: 'bar'}, {key: 'baz'} ...

Google custom search (or alternative) in XHML

Google's JavaScript API makes use of the function document.write, thus is not usable in XHTML. Do you know a workaround how to get the custom search working in XHTML? Or is there a working alternative? ...

Call a javascript function at distinct time intervals

I've created a stock ticker function and need to call it every 2 minutes. I've succeeded in doing this with the javascript setInterval function, but the problem is on the first call it waits 2 minutes before calling the function, whereas I want the first load to be called right away. function CallFunction() { setInterval("GetFeed()",...

How can I center an image in this kind of script?

I've tried various approaches, I've no clue how to do it without destroying the script or rescripting it all. Here's a link to the page: http://hem.bredband.net/noor/bildspelet.html You need to click the edit button on the top left, put 2 URLs to pictures, take these e.g. http://barcelona.magicka-evropa.cz/images/fc-barcelona.jpg http...

move caret to the end of a text input field AND make the end visible

I'm going insane. I have an autosuggest box where users choose a suggestion. On the next suggestion selection the value of the text input box exceeds its size. I can move the carat to the end of the input field crossbrowser, no problem. But on Chrome and Safari I cannot SEE the carat at the end. The end of the text is not visible. Is th...

Regular expression to extract text between two sets of characters (Javascript)

I would like to extract some text between two points in a string, in Javascript Say the string is "start-extractThis-234" The numbers at the end can be any number, but the hyphens are always present. Ideally I think capturing between the two hypens should be ok. I would like the result of the regex to be extractThis ...

How to communicate between ASP.NET and an Excel workbook

Is there a way to load an Excel document in a web page and communicate with the excel control using code behind? (JavaScript or Asp.NET) ? ...

Javascript to Get Address Bar Value

Hi everyone, Does anyone know how to (or if it is possible) to get the address bar value after a user tries to navigate to another page from my site? To be clear, I'm not looking for the value stored in window.location (since this is the page that the user will currently be on), but rather the site that the user is trying to navigate...

Opera: avoid wait cursor during img-src-refresh?

On a web page, I have an image continuously be refreshed by updating the src-attribute of the corresponding img-tag. This seems to work very well with a broad range of browsers. However, in Opera 10.51/WinXP/32, every time the image is updated, for a fraction of a second, the wait cursor is shown. It may confuse users. So, how do I get ...

Code Analysis for CSS, HTML and javascript

Can anybody point me in the direction of software similar to StyleCop for C# which can analyse CSS, HTML and javascript against sets of predefined rules / custom rules. For Example, css - to ensure camel case is used for class names html - to ensure inline sytles are not used javascript - not sure yet :P Ideally, tools which can ...

Is it wise to call array.splice() whenever a row is clicked in a grid

I need to keep track of indexes/rows that are selected. When a row is selected in a jqGrid, I have an event splice an array - add if selected, remove if deselected. Is this wise? I just have a "doesn't seem like a good idea" feeling, so I'm really just looking for some validation one way or another :). ...

slanted design via html css and javascript ?

How can i achieve http://jdstiles.com/java/angledtext2.html this kind of angle(slant) using html , css and javascript. In design we have tabular structrer and by clicking on a tab the area beneath should refresh without reloading page (some thing like jquery or ajax). ...

Looking for nice Javascript/jQuery code for displaying large tables

I have an HTML table which may contain thousands of rows (number of columns is not a problem here). I would like to be able to browse this table easily and be able to do the following: Decide how many rows will be presented Jump to the next/previous X number of rows Scroll the table using the scroll bars to any desired line Be able t...

Detect Autocomplete

Hello, I have some forms that have inlined labels. I have some javascript (jQuery) that detects when focus has changed or when a user is entering text that changes the class so that the inlined label disappears and isn't blocking the user's view of their entered text. The problem I'm having occurs when the browser autocompletes the fo...

Clicks on a Flash / Silverlight object under a HTML overlay

Hi, is it possible to let clicks on a HTML element that's overlaying a Flash or Silverlight object bubble through to the Flash / Silverlight object? I've been experimenting with this, but i can't figure out if it is even possible because of possible security restrictions to prevent clickjacking. I don't have access to the source code to...

In JavaScript, how can I return a boolean value indicating whether a key is present in a JSON object?

Hi all, I have a fairly simple question: In Javascript how can I return the boolean (if its found in the JSON) rather than the actual value? Example: var myJSON = { "foo" : "bar", "bar" : "foo" }; var keyToLookFor = "foo"; var found = myJSON[keyToLookFor]; if (found) { // I...

jQuery rotator not rotating properly - too much recursion

I've built a custom jQuery rotator using just basic animation to rotate the 3 Divs (images). I've built the function and then reinitiate the function using it as a call back. Here's the code: function ImageRotate() { var CurrentFeature = "#container" + featureNumber; $(CurrentFeature).stop(false, true).delay(4500).animate({...

Saving special characters using FCK Editor

Hi, I'm using FCK Editor, and in the Special Characters I've added °, degree (& deg; or & #176;). When degree symbol is added, the source contains "& deg;", but when I'm sending to the server it is being assigned internal to a textarea and this degree symol is not being converted and is being sent as ° (degree), because of this the sam...