javascript

Content is cached

Hello, I am making a portal page for a project, and a div contained is refreshed every 1000 seconds. The problem I am having though, is that the content that is being pulled in is always cached, so refreshing has no effect, the user has to do a hard refresh. This only occurs in Internet Explorer Here's the javascript code I used to re...

How do I dynamically show and hide an entire TabContainer using DOJO?

DOJO seems to have some quirks here. I specifically need to have the TabContainer hidden when the page loads, but then become visible after the user clicks a button. The first thing I tried is setting style.display = "none" to start, and then setting style.display = "block" on the click event. Unfortunately, this only partially works- th...

How to use IE7 Javascript memory leak detectors?

I downloaded the "Javascript Memory Leak Detector" for IE mentioned elsewhere on SO and also here but cannot figure out how to use it. Apparently there used to be another blog post that perhaps went into this detail, but the link to it from the above link is broken. I've also tried using sIEve and it does a decent enough job except tha...

Difference between Dynamically changing pages vs 2 static pages

I want to build a site that will ask if the user is male of female and then use that information to change all the pronouns on the page(s) to match the user selection. So if you enter male, then the page(s) will change all personal references to (him, his, he, etc). My choices are: 1) build 2 sites and have the user input direct the user...

Printing a hidden iFrame in IE.

This solution works fine in Firefox 3.0+, but IE8/7 is just printing the entire page, not the specific iframe. This is the function that gets called when the print link is clicked: var printfunc= function(){ var url = http://someurl.aspx; //This iFrame has style="visibility: hidden; position: absolute; left: -9000px;" var printIF...

Custom JavaScriptConverter Classes

Does anyone know of decent examples of custom JavaScriptConverter classes? The MSDN's only example is of one converting a ListItemCollection. What about custom classes? What if the custom class has a property of another custom class? Do we need two converters? Any references would be greatly appreciated. Thanks! ...

jQuery / javascript - How to Check if select box matched original value ?

Hi there, Just wondering if there is any way to check if the value of a select box drop-down matches the original value at the time of page load (when the value was set using 'selected = "yes"') ? I guess I could use PHP to create the original values as javascript variables and check against them, but there are a few select boxes and i...

UIWebView scrollBy replacement.

For an iPhone app I was using window.scrollBy to scroll to the bottom of a page. The page is rendered in a UIWebView. This all worked fine untill sdk 3.0. It is documented that scrollBy is not supported in UIWebView anymore. Is there an handy javascript replacement for window.scrollBy? ...

Are there any issues with using Niceforms?

I just came across Niceforms and they look..well, nice. I was wondering if anyone has used these? Are they fully cross browser compatible? Are there any other issues? ...

How do I loop through a regex's matches inside a replace in javascript?

I have the following JavaScript (the spaces in the <P>s are non-breaking): var html = '...<li>sub 2</li></ol></li></ol>\n\ <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n...

How can I maintain control of the this keyword when extending prototypes in jQuery?

I'm implementing a class-like structure in jQuery, but I'm having some trouble when I try to call some of my functions. This is how the structure is setup: MyClass = function(name) { this.init(name); } $.extend(MyClass.prototype, { init: function(theName) { this.myFunction(); // works $('.myclass').each(function(){ ...

How to call/bind a jquery datepicker to a label or div instead of an input field

I'm working with the jqueryui datepicker on this page - http://jqueryui.com/demos/datepicker/ How do I call it on a label instead of an input field? Is this possible? ...

jquery - make a div appear where I click?

Hey, I'm trying to make a little feature where I can click on an icon, and a box will appear that is similar to lightbox, but anchored on the icon. Is there a way to Tell where the icon is on the screen, and then Have the top left corner of my box placed where the icon is, and then Have my box appear in that location? Thanks! ...

Javascript: Adding attribute dynamically to the <html /> tag

I'm trying to add FB xmlns attribute to the document's <html> tag (<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt;) dynamically. For some reason adding it like below does not work: htmltag = document.getElementsByTagName ('html'); htmltag[0].setAttribute("xmlns:fb","http://www.facebook.com/2008/fbml");"); How ...

How to fade in appended HTML with jQuery?

I have the following line of code: var html = "..."; $("#id_name").append(html).fadeIn("slow"); This causes the entire div #id_name to fade in. I want only the appended HTML to fade in. How can this be accomplished? ...

little folding triangles?

Based on the style of the 'turning' triangle that opens up a sub menu. Say I had a form that had lender name address city.... how would I add extra section to that form for a second lender name address.... ? Not many people are going to need this on my site but the one's that do, must have the extra fields. I would like to conceal the e...

How do I disable html copying from a webpage, so that only text gets copied?

Is it possible to have JUST TEXT copied when a user copies a url from a webpage to an HTML-enabled application such as Word of Outlook? Perhaps there is something I can do in Javascript? I know how to disable Copy + Paste completely, but I really need to disable HTML copying only. Thank you very much. ...

Javascript regular expression match on string followed by number?

I have a string of the format: string:num where num is any number but string is a known string that I need to match on. I'd like to have this in an if statement as: if( it matches 'string:' followed by a number) { //do something } ...

Why is the resize event constantly firing when I assign it a handler with a timeout?

I assigned a timeout to my window.resize handler so that I wouldn't call my sizable amount resize code every time the resize event fires. My code looks like this: <script> function init() { var hasTimedOut = false; var resizeHandler = function() { // do stuff return false; }; window.onresize = function() { if (hasTi...

Validating button click event using JS from inside ascx nested inside updatepanel

Hello I have a button inside an ascx inside an update panel inside aspx content page. When the button is clicked i want it to run a JS function that causes to show a panel. Here is my Code. <pre> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ABC.ascx.cs" Inherits="App.ABC" %> <script type= "text/javascript...