javascript

how to fix footer at specific height as per content and it get enlarged if content increased

Hi All, Please tell me how to fix a footer at specific height and it will get down as per content its not working properly i want to fix it at specific height. Thanks Mayur ...

Why does jQuery.ajax() add a parameter to the url?

Hi, I have a data fetching method that uses jQuery.ajax() to fetch xml files. /* */data: function() { ...

jQuery - making sure content is loaded before it's faded in?

Hi, Nick Craver really helped me out alot with this code in this thread http://stackoverflow.com/questions/2743443/jquery-can-someone-help-stitching-jquery-code-with-ajaxcomplete/2743791#2743791 And it is working. But I notice that there's a small delay after I've clicked a link and before the content is actually loaded. It's not very i...

How to acces a global variable in a callback object in javascript YUI without use window.myvariable ?

I have this : var MyObject = function(){ this.url = "monurl"; this.mavar = ""; this.Load = function(){ var callback = { success: function(o){ mavar = o.responseXML.getElementsByTagName("montag")[0].firstChild.nodeValue; } } YAHOO.util.Connect.asyncRequest('GET',url,callback); } } ...

HTTP redirect fallback

Hi, Is there a way to provide fallback URL when HTTP redirect times out? What I'm trying to achieve is that when I hit the original url, I would respond with HTTP redirect (300, 307?) giving the browser new URL and the fallback URL in case the new URL times out? I was also considering doing this client side but it just does not seem t...

Is there a way to have element behind a div (links) clickable in areas where the div is "transparent".

I have a block element that is positioned absolutely and some other elements on page that are positioned fixed. The effect is the block on top floats over the page which works well. The links in the elements at the bottom underneath are not clickable. They shouldn't be when the content of the div is over them, but when the "marginal" ar...

In javascript, execute a function when the first function is ready

Is there any way, in javascript, to call on a other function when the first function is "ready" something like this: ridiculousTimeConsumingFunction().onReady( newFunction() ); To illustrate my example you can take a look her: http://web.cinaird.se/pdf/test.htm ...

What are the top javascript pitfalls?

I'm planing on giving an introduction talk on JavaScript and in the preparation process I wondered what the top pitfalls are that rookies fall into. I know I've had a few gotchas before I fully understood closure, but much of the strange behavior in JavaScript is not something I think about any more... So, which pitfalls should you def...

How to get parallel behavior in Java Script ?

More or less I want to execute two functions in parallel. One way as I see is doing through SetTimeOut function. I have not completely gone through the ReactiveExentension, although it looks promising but may be overkill for my needs. Is there any framework which supports parallelism ? My use case is trivial, but I would like to kno...

Hide div after specific time and after buffer the flash video.

Hi i embed a video in my html page and i want to hide div after complete the video. and a specific time.my video time is 12 sec. I am using this function $('#fvideo').fadeOut(12000); and html code. <div id="fvideo" class="video"> flash video </div> UPDATE actually what i want is that flash video fadeOut time should...

Enable/disable zoom on iPhone safari with Javascript?

I have 1 page which has 2 DIV elements which is shown/hidden based on user click on action buttons with javascript, I would like to toggle scaling on action button click. I tried with below javascript and it is changing viewport meta but getting no effect. Any suggestions? Blockquote var ViewPortAllowZoom = 'width=device-width;';...

TinyMCE: experiences, options

Hi I am considering using TinyMCE to handle the textboxes on sites I develop. I have the production version downloaded. At first I will be using it for the backend of a client's site on a deadline and I need it to work out of the box initally. In the future I also like the customisation options. Basically, does TinyMCE work, is it sta...

Greasemonkey failing to GM_setValue()

I have a Greasemonkey script that uses a Javascript object to maintain some stored objects. It covers quite a large volume of information, but substantially less than it successfully stored and retrieved prior to encountering my problem. One value refuses to save, and I can not for the life of me determine why. The following problem c...

Using jquery statement within a jquery data object

As part of a jquery function u use this ajax post statement to get some reaction from a server. I want to pass some arguments to my test page. But these must be variables and are declared on the previous lines (iid and inst) How can i put these variables within the data object marked with the XX? iid = $(this).attr('iid'); inst = $(th...

Select list shrinks in size horizontally when empty

Hello, I have two select list boxes and i can move items back and forth between them using the forward (-->) and backward (<--) button. However, if there are no items in a select list, it shrinks in size horizontally. Any way to keep the select list a fixed size, irrespective of whether it contains any options or not ? Below is the cod...

Setting background-image with javascript

In chrome, safari, and opera setting the background image to an absolute reference such as: "/images/image.png" changes it to "http://sitepath/images/image.png". It does not do this in firefox. Is there any way to avoid this behavior, or is it written into the browser's javascript engine? Using jquery to set the background-image also d...

How to do the image fade-in effect upon scroll (like mashable.com)

Hi, I'm wondering about the fade-in effect for images on mashable.com (see http://mashable.com/2009/08/14/google-android-logo-remixes/ for example) As you scroll to the image, it fades in. It's not fading in on page load, only upon the actual appearance of the item on-screen. Thanks. ...

Folder check in javascript

Hi, How to check whether a folder exists or not using Javascript? Thanks, Karthick ...

jQuery - Set min-height of div

This is probably really easy for most of you. But I'm in need of a small snippet that looks up the current height of a div (the div has a dynamic height based on the content inside it) and then set that value in the css class's min-height value. Basically what this means is that I want this container to have it's min-height to be the ex...

What's wrong (or right) with this JS Object Pattern?

Here's an example of the pattern I'm using in my javascript objects these days (this example relies on jQuery). http://pastie.org/private/ryn0m1gnjsxdos9onsyxg It works for me reasonably well, but I'm guessing there's something wrong, or at least sub-optimal about it, I'm just curious to get people's opinions. Here's a smaller, inline ...