javascript

Displaying proper date format depending on culture.

I am using a control for a popup calendar date picker. This uses a javascript function, SetText, to set the textbox to the given date. I can't change anything in the calendar control itself but I can override the SetText function. The SetText javascript just takes the TextBox name and the date value in string format and sets the TextB...

table highlights only in tbody

Hi Guys, first post... I have several pages to do with several table on each page. I've got the JQUERY to do zebra stripes on even lines and change colour on hover. but, here it comes, it changes colour on THEAD and TFOOT and i can't apply css to TFOOT to change colour. Thanks very much in advance.... here's the code <script type="te...

Best way to implement an "endless page" in rails?

Pagination sucks! The user should be able to scroll down forever, automatically pulling in new content when appropriate. There's a decent rails cast about this, but Ryan admits that his solution won't work in IE. What's the best way to accomplish this in Rails (preferably in a jQuery-friendly fashion)? ...

ASP.NET - How to load page via server-side code (C#) with MVC Pattern in place?

I am trying to use more server-side code (MVC pattern in place) and one of the methods that I am thinking of implementing is something like: LoadWebPage(). If a user is on a page, say Page1.aspx, and they click on a hyperlink, I would like to call the above method, LoadWebPage(). But the problem is, I do not know how to load another pa...

Keeping a jQuery .getJSON() connection open and waiting while in body of a page?

I'm writing a basic push messaging system. A small change has caused it to stop workingly properly. Let me explain. In my original version, I was able to put the code in the of a document something like this: <head> ...text/javascript"> $(document).ready(function(){ $(document).ajaxStop(check4Updates); check4Updates(); ...

HTML/JavaScript UI widgets GUI builder

I've heard and used some of the libraries like Ext JS, qooXdoo, jQuery UI, dijit. I know there are unofficial attempts to create GUI builders but they are not really great. Any chance there is a HTML/JavaScript UI widget library with a decent GUI builder? ...

How can I know when ajax loaded content finish the images loading?

Hi, I'm loading html from an ajax request, and some img tags in it. I need to know when the images loaded in the ajax are fully loaded to resize the container. I don't know how many images are in the result, so I can't simply check the .complete value. Do you know a solution for this? Thank you! Leandro ...

Is it possible to intercept the file from a <input type=file> in javascript?

Is it possible to read the content of a file that has been selected with a file input control? I wish to do something like: <input type="file" id="fileInput" onblur="readFile(this)"/> <script language="javascript"> function readFile(file) { document.write(file); } </script> Is anything like this possible? or does the file ...

Populating A Page with XML and Javascript/Jquery, checking if the url is the same as an xml tag

Hi, I need to create a javascript function that will write a page based on the url, so basically I am trying to create a javascript function that will check the url, and find the corresponding xml item from there. The reason behind this is so that the html page can just be duplicated, renamed, and the xml updated, and the page will fill...

Has anyone used the Glimmer tool from MIX labs, what is the general opinion?

Mix Labs have released the Glimmer app, an IDE for making fancy effects with jQuery. I downloaded it & I've done a few things with it. I think it's quite nifty, but I'm not sure I'd use it 'in real life'. What's the general opinion on its usefulness & the quality of the code it generates? ...

JavaScript/HTML in UPPER or lower case?

Is it better for sake of compatibility/JIT-Compiling performance to use UPPER CASE or lower case, in JS/HTML? For eg: <DIV> my content </DIV> <div> my content </div> ALERT(DOCUMENT.LOCATION); alert(document.location); This is not a newbie question, I know lowercase is the de-facto standard. But since I've seen some uppercase JS+H...

What is the reason behind JSLint saying there are "too many var statements"

JSLint (with the onevar flag turned on) is flagging some javascript code that I have with the following: Problem at line 5 character 15: Too many var statements. I am happy to fix these errors, but I'd like to know, am I doing it for performance or because it is just a bad practice and has a greater potential to introduce bugs in my ja...

In RoR how do I dynamically show and limit the number of characters allowable?

For example, the comments in SO shows the number of allowable characters remaining. Basically, how do I do that in ruby on rails? ...

DIV auto scroll

I have a div that has a large number of items in it. I select these items dynamically by clicking a button, overflow is auto in my case. What I want is that when an item that is not visible is selected to scroll the div so that can be visible. How can I do this? ...

Please help to optimize simple JQuery functions

I have a such fuctions for Jquery: $("input").focus(function () { $(this).addClass('focus'); }); $("input").blur(function () { $(this).removeClass('focus'); }); $("select").focus(function () { $(this).addClass('focus'); }); $("select").blur(function () { $(this).removeClass('focus'); }); $("textarea").focus(function ()...

Javascript / JQUery Dynamic Variable Access

I have a javascript variable which is referencing a complex object (it is a slideshow control but that's not important) e.g. var slideshow = new SlideShow(); Because i have multiple slideshows on the page and I want to make accessing certain operations generic/reuse code in different pages. I WANT TO BE ABLE TO ACCESS DIFFERENT VARI...

JQuery URL Event Listeners

I'm trying to get JQuery to highlight an element based on the link ID selector For Example <a href="#thisid">Goto Element with ID name</a> Highlights the element below. <div id="thisid" class="isNowHighlighted">FooIsCoolButNotBetterThenBar</div> Iv tried searching for relevant plugins but no joy. Any ideas? ...

Generate pdf in the background.

I have a classic asp page which generates a PDF serves it to the browser. What I would like to do is have a loading page which loads the PDF in the background before serving it to the browser when this is complete, essentially adding a nice page indicating to the user that something is happening. I have looked at things like the Yahoo p...

Fast open source checksum for small strings

I need a quick checksum (as fast as possilbe) for small strings (20-500 chars). I need the source code and that must be small! (about 100 LOC max) If it could generate strings in Base32/64. (or something similar) it would be perfect. Basically the checksums cannot use any "bad" chars.. you know.. the usual (){}[].,;:/+-\| etc Clarifi...

How do I print a pdf from within an iframe?

At cbjsonline.com, I'm trying to have a pdf in an iframe print automatically with javascript. Currently, my code is - (connected to the onclick of the link that opens the iframe) - document.getElementById('fancy_frame').onload = setTimeout('window.print()',2500); Any suggestions? This method only works in safari. ...