javascript

How do I create a "check all" link for a web form?

I've got a form with a bunch of checkboxes on it, and I'd like to provide a "check all" link/button. I'm using the code below, but when it runs, it picks up some radio buttons on the page, and checks/unchecks those too. How do I fix this? var check = 0; function doNow() { void(d=document); void(el=d.getElementsByTagName('INPUT'...

Best Javascript library for drag and drop?

Hello, I'm looking for the best JavaScript library for handling complicated drag and drop operations. I'm interested in implementing a grid-based inventory system for my own Web 2.0-style RPG, like Baldur's Gate or Neverwinter Nights (with variable-sized but rectangular items). Lots of Javascript frameworks seem to have drag & drop imp...

How to get a SharePoint-UserField with JavaScript ?

Hallo, i need to write some javascript that gets the contents of a userfield in a sharepoint-website. I can get most fields with the javascript-function 'getTagFromIdentifierAndTitle' of Using Javascript to Manipulate a List Form Field, but not UserFields. So how can i get UserFields? Thanks! ...

In ASP.NET MVC, why do my custom JavaScript files not work in /Scripts?

I can successfully include main jquery files in /Scripts, but if my custom test.js file is in Scripts, it will not work: <script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/jquery-1.2.6.js") %>"></script> <script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/test.js") %>"></script> However, wh...

Iterating Over <select> Using jQuery + Multi Select

This isn't quite as straight forward as one may think. I'm using a plugin called jQuery MultiSelect and multiple <select> options using XSLT as follows: <xsl:for-each select="RootField"> <select id="{RootField}" multiple="multiple" size="3"> <option value=""></option> <xsl:for-each select="ChildField"> <option value="{C...

How to Access ASP control located in a user control via JavaScript

Hi All, I'm designing a user control, briefly it contains an asp:hiddenfield control, i'm going to access it via JavaScript function like this function doAnyThing { var myVar = document.getElementById("myHiddenFiled"); } but when I trace my code I found myVar assigned to null, does it matter document.getElementById() method i...

JavaScript debugging issue with vs2005

I encountered a strange problem today. Whenever i put a breakpoint in one of my js files, the breakpoint is not hit. I use Visual Studio 2005 in combination with TFS. In ie the disable script options are both disabled. The only thing that changed is that I installed Visual Basic 6 for an old project, but I don't see how that would imp...

Open File Dialogue box in JavaScript

Hey all, how can I get an "open file dialogue" box in Javascript? ::) Thanks in advance :) Edit: Duplicate of: open-file-dialogue-box-in-javascript and javascript-file-uploads ...

How to unregister an event handler in Internet Explorer 6?

I am registering a function with the onload method of a html form, I need to unregister this event hander function on unload of the form. How do I do it in Internet Explorer 6? ...

Why isn't jQuery $('.classname') working in IE?

With valid HTML the following finds the object as expected in all browsers but gets NULL in IE (6 & 7). $(document).ready(function() { alert( '$(.rollover):\n' + $('.rollover')); }); I've tried by switching it to something simpler like $('a') but I always get NULL in IE. Update: After running the page through the W3C validator (a...

Is there a way to password protect HTML pages without using a server side language?

I have a series of interlinked web pages, and I want to restrict access to these pages by asking the user to provide a login and password. However, my hosting account currently does not provide any facility for server side scripting - is there any way I can accomplish this objective using only client side scripts? I was wondering how th...

Can I receive a stream over HTTP with JavaScript, Flash, or Silverlight?

I'm prototyping a realtime notification mechanism using http over port 80. The aim of the project is to allow a Flash application to respond to an event on a remote server quickly (specifically an inbound phone call being connected to a phone next to the computer.) Polling is one approach, but is too slow. Currently I use a socket connec...

"SelectAll" checkbox not working when back button on the browser is clicked

I have the following html page: <html> <body> <script> var check = 0; function doNow() { void(d=document); void(el=d.getElementsByTagName('INPUT')); for(i=0;i<el.length;i++) { if(check == 0) void(el[i].checked=1) else void(el[i].checked=0) } if(check == 0) check = 1...

How to embed additional jQuery plugins into Greasemonkey

So I've been able to get Greasemonkey and jQuery 1.2.6 to work together without issue, but, now I'm wondering how to embed additional jQuery plugins into my Greasemonkey script, such as Eric Martin's SimpleModal plugin (http://www.ericmmartin.com/projects/simplemodal/). The following code gets jQuery loaded, but I'm not sure how to get ...

Validating one or the other

I've created a javascript function that allows me to validate if one field or the other is filled (called, shockingly enough, oneortheother). Essentially, it checks if neither is filled, or both, and throws an error. One of the fields being validated is a input type="file" field. I'm displaying below the field the existing file, so tha...

JavaScript - function to get real image width & height (cross browser)

as the title ...

how to get GET and POST variables with JQuery?

How do I simply get GET and POST values with JQuery? What I want to do is something like this: $('#container-1 > ul').tabs().tabs('select', $_GET('selectedTabIndex')); ...

Image previewer for webpages

I am creating a webpage in html with php. I want the user to be able to click on a small icon image. When the icon is clicked a preview of a larger image appears. Guessing the solution probably involves javascript or flash. Can you point me to the right direction. Thanks in advance. ...

Greasemonkey: Text processing - What's the best way to find certain words in a website and have a function work on it?

I want greasemonkey to scan through a website and change certain words to something else. Is there a way to do it with regex or some other string processing function in javascript? Thanks for your help :) ...

How do you create a JavaScript Date object with a set timezone without using a string representation

I have a web page with three dropdowns for day, month and year. If I use the JavaScript Date constructor that takes numbers then I get a Date object for my current timezone: new Date(xiYear, xiMonth, xiDate) Give the correct date but it thinks that date is GMT+01:00 due to daylight savings time. The problem here is that I then give t...