javascript

Is it possible to create a purely client-side GWT application?

I'm fairly familiar with GWT - having completed the Eclipse-based tutorial. But the tutorial runs in client-server mode. My question is: is it possible to create a GWT application that completely runs client-side, where javascript/html is generated but there is no reliance on backend java classes? I understand that the full breadth of...

Obtaining body background color via Javascript (jQuery) in Webkit & Opera

This code only seems to work in Firefox. Safari and Opera don't like it: alert($("<body>").css("background-color")); I've tried other methods too which are even less successful. alert(document.getElementsByTagName("body")[0].styles.backgroundColor); alert(document.body.styles.backgroundColor); I've tested these browsers on Mac - an...

JavaScript - DOM nodeValue problem.

Why the function NodeValue__Two() show null? To me, it should show the same thing as the function NodeValue__One(). I have tested this on IE6. <html> <body> <script language="JavaScript"> function NodeValue__One() { alert(myNodeOne.childNodes(0).nodeValue);//This is OK } function NodeValue__Two() { alert(document.all[6].nod...

How to get Radio button values through submit form via Extjs BoxComponent?

Hi, I am having some difficulties in making a form submission via a boxcomponent. I am using the boxComponent as I have customized button image, and strangely the transparency only works with boxComponent. Basically the idea is that when I click on my boxComponent button, it will do 2 things: Submit 2 radio button values and 1 combo...

How to map two strings using java

Hi I have two strings Listing1(one in html format) <ul> <li id="1"></li> <li id="2"></li> <li id="3"></li> <li id="4"></li> <li id="5"></li> <li id="6"></li> </ul> Listing2(one in json format) {1:"r1",4:"r2"} I need to fill the html string with the json data provided in listing 2 based on json key and id ...

Calling JavaScript functions contained in .js file

I have a JavaScript file contains various string functions. It is a separate .js file. I also have a .css file that defines the styles of Input Boxes. Some styles are executed on certain events like: focus etc. I want to call the string functions in the .js file on Input Box events. I want to know: (1) Whether to call the functions fr...

Json eval function in javascript

Hi All, var jsonCallbackCode1 = eval("employees = { 'accounting' : [ { 'firstName' : 'Jo''hn', 'lastName' : 'Doe','age': 23 }]}"); alert(employees.accounting[0].firstName); I got the following exception Microsoft JScript compilation error: Expected '}' help me? ...

Create clone of table row and append to table in JavaScript

In JavaScript, how can I add a row dynamically to a table? On a JavaScript event I want to create a similar row and append to the table. ...

Javascript library independent tooltip

Hi all, can anyone recommend me nice tooltip script which is javascript library independent, meaning no help/code from any of libraries such as (jquery, prototype,scriptalicious, mootools,extjs etc.). Here is the one I particularly like but it uses protoype and that is not option for me now, because I'm just integrating something else i...

What does Flickr use for charting?

Recently I was browsing my Flickr account and the stats for it and noticed that they display a very nice chart. What made an impression on me was that it was rendered in HTML and used JavaScript for mouseover effects. Does anyone know if they used some third party charting component, or if they did it in-house? If they did use something,...

Check Duplicate Array

Dear All I have 10 input or more and need to check for this array do not duplicate. if duplicate entry from user will be show that error to user too. sample Check array qty[] if dup. will be show and can not entry <input name="qty[]" type="text" class="InputBox" id="<? echo "qty".$i?>" onBlur="sumTotal('qty[]')" onChange="sumTotal('q...

Open Street Map Marker Manager

Hi! I need kind of Marker Manager for OpenStreetMap like in google maps. Do somebody know anything about it? ...

Re-Focus Browser in Javascript when Dragging File from Desktop

Hey there, When I drag a file from the desktop to the browser, and I keep the browser in focus (Safari or FireFox for now), I know everything works right (dragging, having the app respond, etc.). I am also able to un-focus the browser, by clicking on my desktop for example (keeping the browser in view), and when I drag the file to the ...

What's the most reliable way to check a javascript is null?

What is the mos reliable way if I want to check if the variable is null or is not present?. There are diferent examples: if (null == yourvar) if (typeof yourvar != 'undefined') if (undefined != yourvar) ...

What are best efficent ways to call WebService methods from JavaScript?

Hi, Actually I came up with this question, because of an example in one book I have tried and which did not work somehow. I am following "Professional JavaScriptâ„¢ for Web Developers Nicholas C. Zakas" from Wrox. In its WebService chapter it is using "webservice.htc" webservice behavior to call a web service. I have tried to run that and...

JQuery/Javascript pageflip

Hello guys, can somebody tell me how this pageflip is implemented, and any samples would be appreciated. http://www.cataloguecentral.com.au/Catalogue/BIG-Christmas-Gift-book-6610 Thanks ...

window.onbeforeunload not firing in child window

I want to bind a function to the beforeunload event of a child window in Javascript. I have the following code: newWind = window.open(settings.url, "Dialog", "width=" + settings.width + ",height=" + settings.height + ",resizable=" + settings.resizable + ",scrollbars=" + true); newWind.onunload = function() { alert('test'); } Works fi...

How can I attach JavaScript events to table cells created at runtime?

I have a page with two links. On each, I've attached a JavaScript onmouseover event. I require a tooltip to be displayed when the mouse encounters a link, and require that it should not disappear until I point the mouse at the other link. The problem is that I create table at runtime, and I want to display tooltips for the table cells ...

changing the scope of an anonymous function on a setTimeout causes a weird warning

this has interested me purely as research and personal development. i have a namespaced set of functions / variables. within 1 function I need to call another through setTimeout but keeping the scope to 'this'. i am struggling with this a little, can't seem to bind it for when the setTimeout runs. var foo = { ads: ["foo","bar"], ...

What kind of bloody hack is ",this.uiDialogTitlebar).html(f||"

Hi there, I have rebuilt my website with ASP.NET MVC and using all the goodies from that like jQuery. Recently, I'm constantly getting couple of times per day error notification from my website about: Illegal characters in path The request URL includes my domain, my JS folder and then a piece of weird JS syntax in it. Here is an example...