javascript

Is there any way to determine if a connection has been broken when using YAHOO.util.Connect.asyncRequest?

I connect to a .NET handler to upload an image using YAHOO.util.Connect.asyncRequest. The handler then throws an exception because the file is too big. When the exception is thrown, the request connection is immediately cut meaning that the javascript callback for asyncRequest is not called and the user is not notified that the image u...

HTML / CSS autonumber headings?

Is there a way (ideally easy) to make headings and sections autonumber in HTML/CSS? Perhaps a JS library? Or is this something that is hard to do in HTML? I'm looking at an application for a corporate wiki but we want to be able to use heading numbers like we always have in word processors. ...

jQuery dialog not working after server-side redirect

I have an ASP.NET website which uses the jQuery dialog to present the user with a downloads terms dialog. Once the user has agreed to the terms in the dialog, the I perform a server-side postback which issues a Response.Redirect call to a page on another website which is responsible for serving the download to the browser. The problem is...

Widget - Iframe versus JavaScript

I have to develop a widget that will be used by a third party site. This is not an application to be deployed in a social networking site. I can give the site guys a link to be used as the src of an iframe or I can develop it as a JavaScript request. Can someone please tell me the trade offs between the 2 approaches(IFrame versus JS)? ...

Expand list with slideToggle

Hi. I have an unordered list like this one: <a href="#" id="myList-toggle">Show the rest</a> <ul id="myList"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> <li>Item 6</li> <li>Item 7</li> <li>Item 8</li> <li>Item 9</li> <li>Item 10</li> </ul> and this jQuery code: var list = $('#myList li:gt(4...

Check browser's cache for a js file

How can I check for a javascript file in user's cache. If he refreshed the page or visits the site after sometime. I need not download that js file again. Does the js files get cleaned up after a site is closed. ...

Regarding a JavaScript mouse event anomaly I'm having trouble with...

I'm in the process of designing a small RPG-like interface where the user will be given the freedom to create the items and weapons they use. Rest assured, that particular system is thought deeply through and is not the cause of my concern. : ) No, it is something related to the mechanism I have set up for the actual drawing of the user...

styleWithCSS for IE

I'm building a custom RTE that converts user input to a homebrewn markup, now idiot that I am I did this using an iframe with designMode = "On" and got it to work in firefox using styleWithCSS = false so that I could easily convert the <b> (yes... b :( ) into my markup which would then output the proper code instead of me having to read ...

pass value to iframe from a window

Hi friends, I need to send a value to a iframe, The iframe is present within the current window. How can i achieve this? I need to do with in javascript of the parent(current) window. ...

avoiding page refresh when rewriting html with outerHTML

I have to read, change and rewrite an HTML OBJECT tag using node.outerHTML. on IE7. There is a brief refresh of the screen when I do that. I guess that the browser repaints the screen when I write the HTML. The actual OBJECT tag data is the same as before with only one parameter (wmode) that has changed. Size of the object and other pa...

JavaScript: Change browser window status message

It was once possible to change the message a browser shows in the status bar at the bottom of the window. This functionality has been disabled in newer browser versions due to abuse. <script type="text/javascript"> window.status = 'hello world'; </script> Is there still any way to achieve this (consider jQuery available)? I think I st...

JavaScript: Insert ellipsis (...) into HTML tag if content too wide

I have a webpage with an elastic layout that changes it's width if the browser window is resized. In this layout there are headlines (<h2>) that will have a variable length (actually being headlines from blogposts that I don't have control over). Currently - if they are wider than the window - they are broken into two lines. Is there a...

Retrieve the content of an iframe

Hi, I have a window, with an iframe in it. When i clicking a button, then the iframe will load (loaded from a web site). Is it possible to retrieve the content of that iframe? How can I retrieve the content of that page? I can view the source code by left clicking iframes View Source. I need to store the source in a DB. 1. var ifram...

Teaching JavaScript to Java programmers

In a few weeks, I'm going to have the opportunity to introduce my coworkers to JavaScript. Previous projects here have used primarily Java and C++. What are the most important or foreign aspects of JavaScript that I need to explain? I have a short list of big things I've already identified: Hashes/dictionaries as objects Prototypal inh...

Creating A Javascript Calendar (Full, not pop up)

I'm having some difficulties creating a javascript appointment style calendar. While it does render, I know there's go to be a much more efficient way of doing it. Does anyone have a pattern they use for creating calendars? I will be using jQuery, but I don't want to use someone's calendar plugin as a) I haven't found one that works for ...

Assign ColdFusion Client Variables Using Javascript

Is it possible to assign variables to the client scope using JavaScript? More specifically, I'm trying to assign a value after it is returned from an AJAX call. I understand that ColdFusion is run on the server side and JavaScript on the client side, but with the proliferation of AJAX, I'm curious if something like this might be possib...

jQuery: CSS Selectors

How would I use jQuery CSS Selectors to find for instance: css class name: "Text" which is a div inside of dom object "wrapper"? ...

javascript calling function inside another mystery

Hi, if I have function Obj1(param) { this.test1 = param || 1; } function Obj2(param, par) { this.test2 = param; this.ob = Obj1; this.ob(par); } now why if I do: alert(new Obj2(44,55).test1); the output is 55? how can 'view' test1 an Obj2 istance if I haven't link both via prototype chain? Thanks ...

I've got a problem with a toggling sidebar using jQuery.

I'm trying to create a simple toggling sidebar using jquery, where it expands and contracts when a button is pressed. The button also changes to another type of button when pressed. The sidebar will expand, but for some reason, it will not move back to it's original position. You can see a copy of the javascript and html at http://www.j...

handling submit event - jquery

I have some javascript that I'm trying to retool using jQuery to learn the library better and I am running into what seems to be a very elementary problem. html: <form id="theForm"> What would you like to do?<br /><br /> <input type="text" id="doThis" /><br /><br /> </form> js: $(document).ready(function() { $("#theForm").submit(fun...