javascript

How to access and browse a network share via browser using javascript?

I'm helping a colleague to code an html page that has to display contents (documents) of a local network share. Html page will not be served by any web server, it will be just a plain html page served by file system. Does anyone know some javascript libraries that let users browse the share, listing files and folders? thanks Michel...

IE not selecting form field when label is clicked an form field is hidden

I am using jQuery to hide form fields (I am manipulating checkboxes and radio buttons). In FF and Chrome, when I click the associated label, the form field still activates and checks. In IE, that does not happen. How can I have the label activate the checkboxes/radio buttons in IE? ...

how to block users from closing a window in javascript?

Is it possible to block users from closing the window using the exit button [X]? I am actually providing a close button in the page for the users to close the window.Basically what im trying to do is to force the users to fill the form and submit it.I dont want them to close the window till they have submitted it. guys i really apprecia...

JQuery Media Plugin playing file outside the webroot

Is it possible to play a media file which is outside the webroot using the Jquery Media Plugin. The server that we are on is windows based. The file path for example is: \server\share\music.mp3 In my testing so far it does not seem possible. ...

IE remove colors for web page when printing.

HI, I have a website with background colours which are important at the time of printing, but IE removes all colours from page. I know there is some settings to disable this on IE, but I can not rely on users to get into IE settings to disable this option from IE. Is there any way to disable this from my web page, or some way arround? ...

Altering ASP.Net Validation controls to ignore JavaScript-hidden fields

Here's a curious case: I have a form with several data-input controls on it. A sub-set of these controls can be shown / hidden by checking a checkbox. All controls and their associcated Validators belong to a ValidationGroup called "Advanced", as does the asp:Button Submit button and a ValidationSummary. The thing is, I don't want the s...

Alternative to an Ajax upload form nested in another form

I have an HTML form to edit the details of a person in a database system I have at my place of work. Part of the form allows the user to upload a picture of the person. However, this is giving me trouble, because I'm trying to make the form more Ajax-y by letting the user upload the picture and see it successfully uploaded before they su...

Passing Javascript parameters between functions

Hi all, Is the following possible: function one(parameterOne) { document.write('P1 = '+parameterOne+'); } function two(parameterTwo) { document.write('P2 = '+parameterTwo+'); } function three(parameterOne,parameterTwo) { this.parameterOne=parameterOne; this.parameterTwo=parameterTwo; x=parameterOne+parameterTwo; document.write(x); }...

HTML changes with element.setAttribute("onclick","alert('Test');") and element.onclick = "alert('Test');";

I got surprised when comparing the following cases: button = document.getElementById("addSugerenciaButton"); if (button != null) { button.onclick = "post_to_url('" + addSugerenciaURL + "', idBuzon', '" + id + "');"; } button = document.getElementById("removeBuzonButton"); if (button != null) { button.onclick = function() { ...

google analytics code is not recording the traffic?

One of my client's site's google analytics code is not working. What is the problem in this code? <script type='text/javascript'> var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&amp;quot; : &quot;http://www.&amp;quot;); document.write(unescape(&quot;%3Cscript src=&#39;&quot; + gaJsHost + &quot;...

center an element?

if i've got a line of links like: <a>foobar</a><a>foobar</a><a>foobar</a><a id="center">foobar</a><a>foobar</a> but one of them got an id="center", could i with javascript or css position it in the center? ...

Is there an easy way to create a confirmation dialog using dojo-toolkit or spring-js?

Hi, In my spring webapplicaiton I would like the user to confirm the deletion of an item before actually do it. I've looked for a simple example using dojo, but so far I didn't come up with a solution that suits such a simple and common use case. Any hints? ...

Spam Prevention/Reduction - Contact Form ?

Hi I want to add a simple Contact form to my web site so that customers can contact me easily. <form> NAME <input type='text' name='name' /> EMAIL <input type='text' name='email' /> MESSAGE <textarea name='message' /> <input type='submit' /> </form> This form would simply email me the customers message. B...

Javascript Sandbox unit testing

I am using QUnit, which is excellent. I have enclosed my JS app in the (function () {})(); sandbox. This hides a lot of code that I don't want public, but I also need to test that code. Here is an example of how this works: (function () { var PublicAPI = window.PublicAPI = {}; PublicAPI.publicFunction = function (fo...

ASP.Net ScriptManager and UpdatePanel ignoring javascript once posted back.

Hi, I am having major issues using UpdatePanels on a website. The problem is that when i use a ScriptManager, all client side JavaScript that was active when the page was originally loaded is lost once an update panel posts back. Here's what i'm trying to do... I have a number of .net calender controls on the same page each within i...

Dynamically generate Javascript with JSP in IE

I try to do something like that 1. <head><% out.println("<script type=\"text/javascript\">"); out.println("function myfunction(){"); out.println("for(int i=0;i<10;i++){"); out.println("alert(message+i);"); out.println("}}"); out.println("</script></head>"); %> and use it like that <body><input type="button" value="abcd" onclick="myfu...

jQuery UI - Plugin for inputting a number as hex?

On a recent project, I need have a hex mask (0x0 - 0xFF) as one of the input fields on an HTML form. I know I could just use a regular input to get the hex value, and then I can validate it along with the other form submission validation. However, for some of the other decimal fields I am using ui.spinner.js (github) to allow the user ...

Handling rapid clicks in jQuery

I'm building a site (with jQuery 1.4) which has a floating (fixed position) basket. Current working functionality (Demo here): When the user clicks the basket itself it toggle slides open/closed and toggles a "locked on" class When the user clicks an 'add item' link in the page it slides open, adds an "on" class and fades in a notice ...

Hidden iframe problem

In IE6 (but also seen in 7 and to a lesser extend 8) I have a problem with my code. I utilise a hidden iframe for Comet streaming. Sometimes when someone manually refreshes the page in Internet Explorer, they don't get the parent page but are taken by the browser to the hidden iframe URL. Anyone seen this before or have any suggestions ...

NodeIterator vs Xpath for DOM iterating/finding in Javascript

Which is better to use when iterating over DOM elements or finding a a set of DOM elements. is Xpath faster? ...