javascript

how to disable parent click

I have a tree of divs: <div id="a" onclick="func"> <div id="b" onclick="func"> <div id="c" onclick="func"> </div> </div> </div> When a click is made on a div it makes it's children invisible - ie click on "a" will turn "b" and "c" invisible. function func{ if ($(childId).hasClass("visible")){ $(childId)....

Onclick not added until after Postback

I have the following: <asp:Button id="SubmitButton" Text="Submit" runat="server" OnClientClick="Do();" OnClick="SubmitButton_Click"/> When the page is first rendered, I go to the view source in my browser and see that the onclick="Do();" is not added to my submit button tag. But when I do a post back, and do the view source aga...

disable firebug on site when loaded

Hey... is it possible to disable firebug when a page is loaded ? i tryed console.disabled; but did't work.. any idéa ? thx ...

How do I traversing a hidden div in Prototype like in jquery?

The jquery way is $("#id:hidden:first") $("#id:visible:last") What's the Protoytype ways? I try using $$(), and it doesn't work. could somebody tell me? thanks a lot. ...

Add different delimiters in javascript toString()..??

Hi, normally JavaScript’s toString() method returns the array in a comma seperated value like this var myArray = [ 'zero', 'one', 'two', 'three', 'four', 'five' ]; var result = myArray .toString(); And it returns the output like this zero,one,two,three,four,five. But I have a requirement to represent the result in this format zero...

how to access inner class field inside javascript

I am having a inner class(static) named SelectProdLineAssociationForm I have also given a declaration like this-- public SelectProdLineAssociationForm selectProdLineAssociationForm = new SelectProdLineAssociationForm(); now on onclick event I want to set the field in the inner class a value so i am document.forms[0].selectProdLi...

Retrieving XML results of a POST command

As part of my GWT application I have a POST method that accepts a file (so I need to use form submission) and returns an updated list of elements as xml. I use the GWT formPanel to do this. The formpanel redirects the results of the post into a separate iframe. Using the dom inspector I can see that the results are actually there. Unfort...

How to catch last iteration inside $.each in jQuery?

var arr = {'a':fn1,'b':fn2,'c':fn3} $.each(arr,function(name,func){ (do something particular for the last iteration) ... }) It'll be best if no additional variables are used. EDIT: I mean LITERALLY last one,which is the last pair I type them. ...

prototype - elegant code to find next sibling

There is the following HTML structure <div> <p class="open">some txt</p> <p>some text 2</p> <p>some text 3</p> <a href="javascript:;" onclick="down(this.parentNode)">Down</a> </div> and when I press down I want to move class "open" to next p tag, here is code that do this, but I didn't think that it most elegant solution ...

how to refer a textbox inside body of html page in a javascript if textbox is not part of any form?

i have coded a header file which contains a input textbox for search.this header is include in body tag of a jsp page as shown below. <body> <include src="header.ssi"> <form> </form> onclick of button i header file i am running a javascript function. i need to refer to this textbox in javascript function. ...

JS exception in a JSP running on WebSphere 6.1

Hi All, I have popup searcher in my application which lists the available record as hyperlink. Onclick of these links we are populating a textbox with the value. The popup is opened using window.open method. The hyperlinks in the searcher looks like this: When I invoke the searcher with IE's debugging enabled I am getting an error at...

Disable link with the prototype observe method...

I want to create a link like this: <a href="http://example.com"&gt;text&lt;/a&gt; and replace the behavior so that the link downloads the content with Ajax instead when clicking. It is important for me not to replace the href attribute (so copying the link still works). One solution would be to do: $('link').onclick = function() { ...

Add to favorites in JavaScript for IE6+, FF and Safari

I tried some "add to favorties" JavaScript scripts.. With IE8, I get an "access denied" (is that even possible to add a bookmark via JS with IE8?) and it just doesn't work with IE6... Anybody has a good script that works on most browsers? Thanks! ...

onComplete and onCompleteAll events failing to fire when using Uploadify

Hi I have been using uploadify (www.uploadify.com) to upload images to my website, and it works beautifully until you try to expand on it a little. Im trying to get it to remove a queued up file from the list once that file has been uploaded. To do this, you would initialize uploadify as such: $("#fileUpload").uploadify({ ...

How can I detect faces using Ruby?

Can anyone tell me how to detect faces in a static picture using Ruby or Javascript? ...

HTML Element, Custom Client Event

I have a composite control which emits HTML that looks like this <span id="myControl"> <select id="myControl_select"> <option value=""></option> <option value="1">Item 1</option> <option value="2">Item 2</option> </select> </span> I would like the parent span control to fire an event when the contained drop dow...

[jquery] append data loaded problem

Hello, My html is like this <div id="rsContainer"> <table id="rsTable"><!-- DATA HERE --></table> </div> and my javascript is like this $('#UpdateAll').click(function() { $('#status').fadeIn('500').text('Loading... This may take a while.'); $.ajax({ type: 'post', url: 'func.php', data: 'action=updat...

How to capture a form element and use dynamically in the post url?

I'm trying to build a form which submits a URL which contains a lon/lat that has been passed over from Google Maps. I have managed to get it so the lon/lat is passed into input fields in the form, how would I go about using these values dynamically in the post URL, i.e.: action="search.asp?[lon][lat] ...

Developing a Betting Slip in Javascript

I'm Project Managing a gambling site and they are looking for a bet slip to handle all of their Sports Book betting. There are two good JS staff working in my team that will be tasked with this but I'd like to point them in the direction of best practices and things to look for. The slip is going to be quite complicated, so having a si...

How to get the value of key a and 'a' in javascript

How to get the value of key a and 'a' in javascript? var obj = {a:1,'a':2} ...