javascript

input validation

How can I check that an input textbox has a float value with no more than 3 places after the point in javascript? ...

How can I run disqus in an iframe?

I'm trying to add disqus comments per-marker on a google map. To make it per-marker, I've added an iframe to the infowindow, with a different URL for each marker. It works, and I can post comments, but the infowindow isn't updated after a successful post; the spinner remains. Firebug says: Access to 'file:///foo/gmap/comments.html?dsq=1...

Where in Windows is the Javascript file which contains functions for executing PAC files?

Proxy Auto Config (PAC) is the traditional method by which web-browsers are automatically configured to use the appropriate proxy for any given site. PAC files consist of a single function implemented in JavaScript. I'd like to execute this function for another puropose: I'm trying to make an application which selects a proxy to use in...

Placing ajax ModalPopupExtender inside User control

I use an ajax ModalPopupExtender on many pages to display confirmation dialog. So i would like to reuse same code on all pages by placing it in a use control. But I'm not sure it it possible to access this user control from a javascript (I don't want server side operations). This is the code that is responsible for popup display, that ...

Jquery: how to register an event on all pages?

I want to run the following jquery code on every page in my website. $(document).ready(function(){ $("#more").click(function(){ $("#morediv").slideToggle("slow"); return false; }); }); In all my pages I have the more and morediv elements defined, for every page I have different js file and adding this code in ev...

Why window.print is printing all pages in IE but only one page in firefox?

I am having a JSP page, where i am dynamically creating a Table data. ( My page is having only table, and nothing else ). Number of rows in table can go upto 1000s. What i am doing is: after the complete page i have written <script> function printPage(){ window.print(); } </script> This code is working fine to print all pages ...

I want to break my text into two parts - asp.net

Here's the problem: I have couple of pages which gets its content from a database. The content is displayed in a Literal control kept on an asp.net page. The article sometimes gets quite long so I want to break the content into two parts using a client script. Unfortunately I cannot change the query to pull data partially. The entire d...

jQuery equivalent of YUI StyleSheet Utility?

Does jQuery - or one of it's plugins - have equivalent functionality to the YUI StyleSheet Utility? "The StyleSheet Utility is capable of creating new stylesheets from scratch as well as modifying the existing stylesheets held as properties of elements sourced from the same domain or any inline elements." This (I'm fairly sure) is cr...

Javascript / jQuery: How to prevent active input field from being changed?

Hi, how do I prevent the user to change the value in an input field (which contains a certain value to be copied into the clipboard) without using disabled="true"? The text should be selected once the user clicks in the field (that's working already) but entering anything should have no effect. Thanks jQuery('input.autoselect[value]')...

JQuery - Grid Row Highlighting Best Practise

I am looking for the best performing script for providing a hover state to rows within a grid. 90% of users have ie6 clients therefore I cant rely on css :hover The grid is a standard table, some cells have inner tables. I originally started using the .live method with mouseover and mouseout, however this has massive cpu implicatio...

Font anti-aliasing issues with jQuery.fadeIn in IE8?

I'm banging my head against the wall with an issue I'm having in IE8. I am using the fadeIn function on jQuery to make the site content fade in. This works perfectly fine in all of the other browsers, but when the fadeIn finishes in IE8 the font anti-aliasing seems to change, causing the text to shift slightly. You can see the site at h...

Passing variable name into GWT's JSNI

Using the JavaScript Native Interface of GWT I can perform the following: public native static String getNativeVariableFoo() /*-{ return $wnd.foo; }-*/; Which will return the contents of a JavaScript variable called foo. How can I expand upon this to accept the variable name as a parameter? ie: public native static String getNat...

When using onclick-event and document.write in javascript, does it always have to open in new window.

Does it have to open in the sam Eg: function write(){ document.write("write") } input type="button" onclick="write()" value="Click" ...

jQuery nextAll -- Click on h-element toggles all p-elements until next h

Hi, i'm creating an FAQ page where the answer is toggled by clicking on the question. The question is h3 and the answer is several "p" elements. Like this: <h3>The First Question</h3> <p>Answer Paragraph</p> <p>Answer Paragraph</p> <p>Answer Paragraph</p> <h3>The Second Question</h3> <p>Answer Paragraph</p> <p>Answer Paragraph</p> Ho...

"ytplayer is not defined" on using the SWFObject method to include a chromeless Youtube video on a site

Code is as follows but I get a "ytplayer is not defined" error. Is this an issue with <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script> google.load("swfobject", "2.1"); </script> <script type="text/javascript"> function updateHTML(elmId, value) { document.getElementById(elmId).innerHTML = value...

Would Like Open Source RSS / News Reader Code or Widget Python or Javascript

I would like to be able to massage certain categories of news feeds to make their entries more consistent. For example, when a job seeker subscribes to two different job sites the feeds s/he gets will differ markedly. One would like to be able to perform lookups and other work in the news reader, process the incoming feed on the basis of...

How to Hide Div then visit Url on One Click

How would I go about setting a link to perform certain functions like hide div then go to destined url something like this $(document).ready(function(){ $("a").click(function(){ $("#div1").slideUp("slow"); $("#div2").slideUp("slow"); // then go to index.html }); }); This is my setup. <script type="text/javasc...

How to implement an Ajax script?

This is a script that, when a link is clicked, will pull a page from somewhere and insert it in a div in the current page. Pretty simple, yes, but being the thick head I seem to be, I can't figure out how to implement it; i.e. how to formulate the link so that it will point the script to the page we want to load in the div we want? The...

Is it possible to know if the type of the uploaded file is an image?

While user uploading a file, is it possible to know if the uploaded file is an image or not, I am open for any solution, Client Side, Server Side or both and we choose based on the case. ...

Javscript book which teaches javascript the language, not dom.

I am a pretty good programmer(IMO only, of course. Know Python, Java well. Tried my hands at Lisp, Ruby, Haskell). I also know how to use Jquery reasonable well, so I know Dom manipulation. I want a recommendation on a Javascript book, which teaches the Language. My criteria are, 1. Fast paced and for programmers who know programming. D...