javascript

Using ASP.NET in browsers that not support javascript.

Is there a way to use ASP.NET in browsers that javascript is not enabled? Whereas all buttons/actions do a postback using javascript by default, i guess that isn't possible, but using ASP.NET MVC could be a solution? What do you think is the best way to deal if the user's browser is with javascript disabled? Block the page access telli...

What would cause myDivId.toggle() to work while myDivClass.toggle() does not?

I have some DIVs that I am using JQuery to hide and show using the toggle() function. This has been working fine. But I just recognized some relationships between some of these DIVs that would allow me to group some of them into a class. I was hoping that this would allow me to toggle the DIV class instead of each of the DIV ids. So ...

How to "refresh" a window in IE without the window stealing focus?

I have a page on which, periodically, I must change the URL to incorporate some GET parameters in the background using JavaScript, such that the page refreshes using the new GET parameters. So, for example, I'll periodically do window.location.href = window.location.host + '?' + ss; or window.location.search = '?' + ss; Where 'ss'...

How does basic object/function chaining work in javascript?

I'm trying to get the principles of doing jQuery-style function chaining straight in my head. By this I mean: var e = f1('test').f2().f3(); I have gotten one example to work, while another doesn't. I'll post those below. I always want to learn the first principle fundamentals of how something works so that I can build on top of it. Up...

Is there a great WYSIWYG html editor component that had Drag n' Drop *like* the Google Waves editor?

Is there a component out there that can be used that provides some of the great capabilities that the Google Waves editor provides (or Google Docs editor)? If it only works on a certain browser, that is fine. If it is part of GWT or some other framework, that is fine. I know that this will probably require Google Gears. I would prefer ...

User input, PHP, Javascript and security

Hi, I am working on a directions service where users enter the from and to addresses and get the directions table ( that gives turn by turn information ) along with a map showing the route. Below is the complete source code ( getdirections.php ): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm...

Access Iframe with Javascript on external domain

Hi. I'm looking for a way to access read-only properties of a page on a IFRAME. Specifically I would like to read the selection. Apparently I can't read it because the document lies on another domain. Is there a way to read them? ...

TinyMCE with non-rectangular boundary

I'd like to use TinyMCE to WYSIWYG support inline editing of a page's body. The tricky thing is that my page body isn't necessarily rectangular or in the shape of a normal textarea. Imagine a news article like this one. Could I make the entire story body an instance of TinyMCE so that my editor wraps above and below the lead image an...

Turning a string match requirement into a Regular Expression

Hello. I'm having a problem writing a regular expression. How could I write the following: start with an optional access level (a digit from 1 to 5) followed by a space then a user name consisting of between 3 and 5 small letters followed by between 3 and 5 digits then one or more spaces and then a four digit pin number then one...

jQuery realtime form validation

I am currently using $.blur(fn();) for form validation, but this only takes effect when the form field loses focus. Is there a way of doing it on keypress to get realtime validation? I suppose I could do the 'poll all fields every second' approach, but I am sure there must be a more elegant way? ...

How to turn a very long column into multiple shorter ones?

This is a challenge question / problem. Hope you find it interesing. Scenario: You have a very long list (unreasonably long) in a single column. It would be much better displayed in multiple shorter columns. Using jQuery or another tool, what do you do? The format of the list is as follows: <div class="toc"> <dl> <dt>item 1</dt> ...

How can I reduce the redundancies in my jQuery code?

The size of my JavaScript file is getting out of hand because I have hundreds of links, and each one has its own jQuery function even though they all peform basically the same task. Here's a short excerpt: $("#link1").click(function () { $(".myDiv").hide(); $("#myDiv1").toggle(); }); $("#link2").click(function () { $(".myDiv").h...

Parameter retrieval for HTTP PUT requests under IIS5.1 and ASP-classic?

I'm trying to implement a REST interface under IIS5.1/ASP-classic (XP-Pro development box). So far, I cannot find the incantation required to retrieve request content variables under the PUT HTTP method. With a request like: PUT http://localhost/rest/default.asp?/record/1336 Department=Sales&Name=Jonathan%20Doe%203548 how do I read...

javascript variables, What does var x = a = {} do?

I see in jQuery something like this: jQuery.fn = jQuery.prototype = {} Why is this being done? Isn't this the same thing just saying jQuery.prototype = {}? I'm not sure I understand what Resig is accomplishing here. ...

Installing VB6 app causes IE6 errors???

I have a VB 6 app that I've inherited, and made some small updates to, but now when it is scripted to install (for SMS, using BITS_INST.exe) and I install it from that script, I get the following javascript error on our portal on links that are attempting to open new windows: Error: 'window.open(...)' is null or not an object This app ...

How to read input in a html page with javascript without focus in one field

Hi. I want to ask how can someone read keystrokes while in a html page without having focus in a particular field. Is there some event that i can hook a method that reads input? Thanks in advance. PS. We use JQuery if that helps. ...

Popup window not opening on IE7

Hi Javascript gurus, I have this Javascript code which is working fine on Firefox , but it is not working on IE 7. Any ideas why? Here is the code function TestWindow() { SimpleWindow('Default.aspx', 'Simple Test', 200, 200, 'yes') } function SimpleWindow(mypage,myname,w,h,scroll) { var win= null; var winl = (screen.wi...

Sending a message to all open windows/tabs using JavaScript

I hear HTML5 has window.postMessage(), but it seems to require having a handle on the window (or tab, throughout this question) you're posting the message to. What if I want to broadcast to all open windows? Is this possible? (What I'm trying to do is warn other windows without any server round-trips when a user does something in one ...

How does global Javascript object save state?

/************************************************************************** * * Function: toggleVis * * Description: Following Function hides and expands the main column. * * ***************************************************************************/ // Set the default "show" mode to that specified by W3C DOM // c...

What can JavaScript learn from Ruby?

The ECMAScript working group has started working on the next edition of the language. What can they learn from Ruby? ...