javascript

Jquery confirmation box

I'm looking to create a generic confirmation box that can be used by multiple widgets easily, but I'm running into problems with scope and was hoping for a clearer way of doing what I'm trying to do. Currently I have the following - (function() { var global = this; global.confirmationBox = function() { config = { ...

JScript Arguments Collection - .Net Equivalent

When writing code in JScript, as I am wont to do as I have never been a fan of ASP.Net and Jscript is infinitely more elegant than VBScript, you can call upon the arguments collection. This is extremely useful to pass into error handlers as you can then output messages to development teams which tell them exactly what the state of the ap...

how to get the day from a particular date using javascript.

hi there, i am new to javascript. my requirement is .. i want to popup a message on particular days(like sunday,monday..) all through when a date is selected. i tried getday() function but it didnot work. please suggest me. i am tired of searching google ...

Javascript object with array, deleting does it actually remove the item?

Oks.. I have an object: data.Dealer.car[0] [1] [2] If I do this: alert(data.Dealer.car.length); delete data.Dealer.car[1]; alert(data.Dealer.car.length); It gives me the same count each time from the alert, even though the actual array element now doesn't exist? Any ideas? ...

jquery - setting the selected value of a select control via its text description

I have a select control, and in a javascript variable I have a text string. Using jQuery I want to set the selected element of the select control to be the item with the text description I have (as opposed to the value, which I don't have). I know setting it by value is pretty trivial. e.g. $("#my-select").val(myVal); But I'm a bit ...

C#/ASP.NET/JS - onclick event shows row, postback hides row

rbnResubmission.Items.FindByValue("Yes").Attributes.Add("onclick", "getCheckedRadioFieldResubmission(this)"); rbnResubmission.Items.FindByValue("No").Attributes.Add("onclick", "getCheckedRadioFieldResubmission(this)"); So I have these click events for showing rows in a table - that part works fine. Here's an example of what the code d...

Is SAJAX dead? What to replace with?

We use Sajax for adding small Ajax code to sites. After running into a problem and doing some digging, it seems the library hasn't been updated since 2005. I've appreciated Sajax for being lightweight, easy to use, and easy to install (just include the file in PHP). So, on the LAMP stack, if you have used Sajax before, what would you...

AJAX Security Norm

Is there a norm for AJAX security? When making an XMLHttpRequest, if querying an HTTPS url, will the browser handle all the certificate business and properly encrypt the request (or use an already existing authenticated tunnel)? Are there any security flaws in this model? Then there's also user authentication issues with AJAX. Th...

How does the location of a script tag in a page affect a javascript function that is defined in it?

I read that you should define your javascript functions in the <head> tag, but how does the location of the <script> (whether in the <head>, <body>, or any other tag) affect a javascript function. Specifically, I would like to know how does it affect the scope of the function and where you can call it from? ...

Asp. net and Javascript pop up windows

I am writing an intranet application and am considering the use of a pop up window. What are your thoughts on it? I am not worried about accessibility since it's an intranet app. The scenario is such as I need to be able to have the same code be used in a server page as well as in the middle of a process; which is why I decided when u...

How do I call a JavaScript function name using a string?

How can I hook up an event to a function name I have defined as a string? I'm using Prototype.js, although this is not Prototype-speficic. $(inputId).observe('click', formData.fields[x].onclick); This would result in JavaScript complaining that my handler is not a function. I would prefer not us use eval(). ...

Inserting Dates into HTML Table Cells

I am wanting to have a series of dates (mainly Month, Day, Year) displayed within a vertical arrangement of table cells on a web page. The first date needs to be the current date minus one day, with the next date in the sequence be the current date, The remaining dates need to incrementally be one day in future out to 16 days. Can som...

How do I find out which Javascript element has focus?

I would like to find out, in Javascript, which element currently has focus. I've been looking through the DOM and haven't found what I need, yet. Is there a way to do this, and how? Edit: The reason I was looking for this: What I'm trying to do is make keys like the arrows and enter navigate through a table of input elements. Tab works...

.net development dynamically created controls need their own methods

Hello everyone, I'm sure that almost everyone programming in .net has ran into similar issues with the dynamic creation of buttons.. Example scenario.. I have a gridview and in one of the gridview fields I have a button. Normally in .net using visual studio you can easily grab the click event of the button, however since these butto...

Produce heading hierarchy as ordered list

I've been pondering this for a while but cannot come up with a working solution. I can't even psuedo code it... Say, for example, you have a page with a heading structure like this: <h1>Heading level 1</h1> <h2>Sub heading #1</h2> <h2>Sub heading #2</h2> <h3>Sub Sub heading</h3> <h2>Sub heading #3</h2> ...

What's wrong with my javascript? Fading images

Hello, I'm trying to make Javascript change the style of certain DIV IDs by changing their background every few seconds. Basically, a fading header...here's my code, and it just doesn't change the background, at all. How do you call a function? http://pixolia.net/sandbox/morph/index.php ...

What to use: Callback, AjAX or simple Javascript in Asp.net app.

I am at a bit of a loss as far as what is the best tool for the job would be: What I need: A parent page has a link, when clicked a pop-up will pop up with a gridview and a save button. If the user saved the gridview, the parent page should refresh and change, in other words I need to be able to pass data between client and server. Pe...

actionscript ExternalInterface namespace collisions

A have a flash widget (a music player) and there are about 10 instances of it on one page. I need to communicate between the flash and the javascript of the page it's embedded in. I haven't done much with actionscript for a long time, but some googling led me here, and to ExternalInterface. It seemed perfect, however there is one problem...

Need help in login validation using javascript

Please could somebody point me out what is the error here? Using javascript i am validating the user input. When i click the login button without checking the javascript function, it goes to the welcome page. Here is my code: <script type="text/javascript"> function validLogin() { if(document.getElementById("txtUserName").valu...

finding the time zone from which a browsers connection to a Web server

I am not into web (client/server)application development, but had this question for sometime - If some web browser (IE/Firefox) makes a connection to some website, is it possible for the web server to find out the timezone of the client, or current local time of the client place, and display the same on the page. If yes then how is the...