javascript

execute a javascript function if the user is not active on the page?

hi, i'm looking for a javascript or jQuery function to execute my function newalert() if the user is not active on the page, ( maybe with some event to check the cursor position or something like this ) i will make it auto check using settimeout , i just want the function to check the availability of user like in gmail chat, when recei...

AJAX request to get results from Google

I want to modify the code in this AJAX example to get results from Google. I take it out the line with the Random() method call, but how do I work with the query string in the JavaScript? How can I best do this using XMLHttpRequest to manually build the request (this is for testing so has to be manually done, as opposed to using a frame...

how to POST radio button values through jquery

i have this example code: while ($row = mysql_fetch_object($result1)) { echo '<input type="radio" name="vote" value='.$row->avalue.'/>&nbsp;'; echo '<label >'.$row->atitle.'</label><br>'; } this displays 4 radio buttons alongwith their labels. now I am using th...

Putting focus on a textbox in onchange event

Hello, I am trying to get it so that when a certain value is put into a textbox, the focus will stay on the textbox(and an alert will be shown in production). I am trying to get this to work in Firefox 3.5.7 with no luck. How can I make it so when a textbox is a certain value at onchange that it will stay focused/refocus on the textbox...

Why GWT? Advantages and Trade-Offs of Using This RIA Framework

I'm new to stackoverflow and have been reading through a bunch of the "highest voted" questions for GWT. Several of these questions talk about the pitfalls or problems with GWT. In the articles: Which Javascript framework (jQuery vs Dojo vs … )? and Biggest GWT Pitfalls?, some posters seem to suggest that GWT is not lightweight enough o...

How can I determine the name of a JavaScript event handler function?

I see some anchor elements on an html page like so <a href="javascript:void(0);" class="clickable">Click me</a>; The page assigns JavaScript event handlers to the anchor element on page load. After the page loads, I can click on the anchor element to fire a JavaScript operation. I want to programmatically fire the anchor's event han...

how to check if javascript is disabled?

how to check if the user disable javascript in his browser? For example: in stackoverflow, a red warning div will show up at the top if you disable the javascript in firefox? How to achieve this? One more thing I noticed: if you disable cookies, stackoverflow doesn't work. It won't let you login when you click the login button. Actually...

Javascript Iterate event handlers/listeners

Is there any way to iterate through all of a node's event handlers? ...

Framework for handling javascript errors well for testing / production envs

Hi everyone, I am just getting started on javascript, and I have experience in developing systems in other platforms and languages. The problems people have with javascript are well known, so i would not repeat them here. But my question is, why isn't there a framework yet for handling error cases? I can imagine a simple library that c...

Mootools events question.

I have the same code for keyup and keydown events, is there any way that I can pass the element to the function so I can call it like element.addEvent('keyup',function(event,element)); on both instead of having to have an inline function? ...

Alternatives to "canvas.toDataURL("image/png");" in JavaScript?

I'm working on a Palm Pre app and I need to find an alternative to "canvas.toDataURL("image/png");". Ideally it could export the canvas image to a jpeg file but png would be find also. ...

Nested JSON objects - do I have to use arrays for everything?

Is there any way to have nested objects in JSON so I don't have to make arrays out of everything? For my object to be parsed without error I seem to need a structure like this: {"data":[{"stuff":[ {"onetype":[ {"id":1,"name":"John Doe"}, {"id":2,"name":"Don Joeh"} ]}, {"othertype":[ {"id":2,"company":...

Replacing the contents of an entire webpage through ajax

Hi, I'm aware that this is kinda a hack but for reasons of simplicity I would like to replace the contents of an entire webpage with an answer received through Ajax. This includes possible HTTP headers. Is it possible to do so? To clarify further, right now I added for debugging purposes: alert(response); and this produces: For rea...

Rewriting HTML code using javascript

I have some markup here that I need to reformat using javascript. Basically, I have this code: <div id="images"> <img src="01.jpg"> <img src="02.jpg"> <img src="03.jpg"> <img src="04.jpg"> <a id="src" href="01.jpg"></a> <a id="src" href="02.jpg"></a> <a id="src" href="03.jpg"></a> ...

Calling javascript from flex

I am using ExtrernalInterface.call(javascript_function, args); to call javascript functions from Flex. But this fails in case of browsers that have javascript disabled. Is there any other way to call javascript functions from flex? ...

How to Write javascript running on the child page (PopUp.aspx) to update the value of a label on the parent page.

any references document ...

Is any complete example for merge or split table cells in javascript ?

Hey folks, I am working on a web project ,One of the features include user can desgin a html Table and allow user split or merge cells feel free,(i am using jquery for my project).any one can help me? Thanks! ...

Posting information and retrieving results using Ajax

I would like to using (Ajax) PHP or Javascript, Post information to http://en.lernu.net/cgi-bin/vortaro.pl then read the results back (Not from lernu.net). I am trying to learn Ajax, PHP + Javascript, Nobody there know's how to help me. I would very much like doing this without touching Lernu's code, So if there is a way to do it al...

Collapse YUI Treview

How do I set up YUI treeview so that all nodes are in collapsed state initially? Is it possible to set up YUI treeview so that it is collapsed if no nodes are selected, but expanded if nodes are selected (only the branch with nodes selected are expanded)? If so, how? Thanks. ...

Regex in GWT to match URLs

I implemented the Pattern class as shown here: http://www.java2s.com/Code/Java/GWT/ImplementjavautilregexPatternwithJavascriptRegExpobject.htm And I would like to use the following regex to match urls in my String: (http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))? Unfortunately, the Java compiler of course...