javascript

jQuery toggle() not working in FF3.0.12

Hi All, I have a jquery code(toggel) which is working fine in IE6 but not in FF3. what can be the reason or workaround. <button>Toggle Me</button> <p>Hi</p> <p>Learning JQuery</p> Jquery: $(function() { $("button").click(function() { $("p").toggle("slow") }); }); CSS: p { background:#dad; ...

Pass in jQuery/plainJS variables/functions of a current scope to anonymous function called from current scope

How to pass current scope variables and functions to the anonymous function in plain Javascript or in jQuery (if it's specific for frameworks). For example: jQuery.extend({ someFunction: function(onSomeEvent) { var variable = 'some text' onSomeEvent.apply(this); // how to pass current scope variables/functions to this functi...

text input keyup event with time interval

I have a textbox. I want to call a ajax callback function with some 2 second delay on every keyup. How to implement this? ...

Dealing with clients behind slow connection

I am working on building an ajax based messaging system. The idea is that client will call server every X number of seconds to get latest messages and some other crucial information. The application depends very heavily on this data being delivered to client. I have tested it on all kinds of connections and everything seems to be working...

Change all span-tags into label-tags with Javascript?

Hey everyone, what I want to do: call an unload-function to change <span>some content</span> into <label>some content</label> Is it possible to change a span-tag into a label-tag with javascript? If it is possible how can I do that? Thnx, ... doro ...

Is google AJAX Libraries API bypassing same origin policy?

From: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript The same origin policy prevents a document or script loaded from one origin from getting or setting properties of a document from another origin. This policy dates all the way back to Netscape Navigator 2.0. So why is not the same origin policy enforced?, when a...

How to send the value from javascript part of code to the ascx.cs code file

Hi, In my .ascx page there was some javascript functions.I want to send the value from this java script function to the codebehind file to execute a method. I tried to use PageMethods but it was getting errors.As i google about this problem i found that PageMethods cannot use with .ascx control pages it can be only used with .aspx page...

removing and appending a node

I want to remove below span elements from the div (<div id='foo'>) and append newly created nodes instead each of them. I am using a loop to traverse all the children of the div, and for each node found I am removing it with removeChild and append an newly created node. I am getting o/p as <div id='foo'> <SPAN>new text</SPAN> </di...

Run a method everytime value changes.

Hi, I wonder if any of you guys can help me with what I think is observing problem. I have an element (svg to be more specific) that I want to update every time a value somewhere is changed. I have variable: GetThreadTree().treeBoxObject.getFirstVisibleRow() that initially is 0. I want to run a function updateCanvas() every time valu...

How to retrieve query string parameter and values using javascript (Jquery)?

Hi <a class="clickme" href="test.php?id=100&status=pending&time=2009" id="p_100">Click me</a> $('.clickme').click(function(event) { event.preventDefault(); var stringId = $(this).attr("id"); var mId = stringId.substring(2) .... I can retrieve the value of id using ID of anchor element. I think I should be able to get it directly ...

experiencing lag in variable passing between popup and opener

Hey all, I am getting some strange (at least to me!) behaviour from the javascript in a web application I am developing. There is a popup window with a form. Upon validation and submission, the information from the form is aggregated into a comma-separated string. This string is then passed to opener window by assigning the string (da...

Search result links from Google Custom Search not working when viewed in IE6

One of the community sites I work on currently has this issue when viewing search results from Google CS in IE6. For example these results. Attempting to click on any result doesn't provoke the browser into following the link. Strangely though, shift clicking or right clicking and opening in a new window both work. Has anybody seen a...

jQuery upload plugin to work with JSP/Java

Hello, I'm trying to accomplish the following: Upload a file to the application by submitting a form (enctype: multipart/form-data) to a JSP action which handles the rest (including writing the file to the disk, processing and returning some xml data about the upload). Until recently, I was using this plugin: http://valums.com/ajax-upl...

jCarousel Problem - Hover images opacity settings

Hi, So far I have got jCarousel to display, and load the images via a txt file, What I want to do is show 4 images at a time, then when the user puts the mouse over 1 of the images the other 3 images to fade opacity, to 30%. Then if they move the mouse to the image next to it I want that image to be 100% opacity and the other 3 images ...

Strange Javascript/cross site cookies problem

I've got a PHP script running on domain B that, when called generates some JS. The idea is that in a given html page I can have: <script src="http://b.domain/myscript.php"&gt;&lt;/script&gt; So when the page loads, the script is called and the JS is generated and run on the local page. The problem is that myscript.php depends on B's...

How do i identify which events have bound via JavaScript?

Possible Duplicates: How to debug Javascript/jQuery event bindings with FireBug (or similar tool) How to find event listeners on a DOM node? How do I detect which events have been bound to a DOM element through JavaScript? In the example below I would like to be able to see that the click event has been bound on my 'clickable'...

JQuery: Turn array input values into a string optimization

Hi all, using jQuery I have the following code: var selectedIdsArray = $("#selectId option:selected").map(function(){return this.value;}); var selectedIdsStr = $.map(selectedIdsArray, function(val){ return "" + val + "";}); It successfully retrieves a string of ids eg. selectedIdsStr = "2,45,245,1" from an <select multiple='multiple'>...

How to check if a text is all white space characters in client side?

How to check if a user input text is all white space characters (space, tab, enter etc) in client side? Thanks in advance! ...

Best way to depend on swfObject in a library

I'm building a JavaScript library for customers to use to embed content my company's product creates into their own web pages. The content itself is a combination of html and flash with some JavaScript glue. We use swfObject to embed our Flash content. My question is: What is the best way to manage this dependency? Currently I'm cons...

Is it worth it to use jQuery for Ajax instead of building your own JavaScript?

Aside from the framework, is jQuery worth using rather than creating your own javascript? I've always debated if the framework was better to use than to create your own calls. Are their disadvantages of using it? Sorry for beginner question, I'm trying to feel out if it would be better to use this and create some of the ajaxish workings...