javascript

Dropdownlist selected Value Sometimes returns text

I have a dropdown list on my form with Integer Values set and displaying text. When I run the following code to display the Value and then associated text, I find that the text is displayed in as value when it is not supposed to. Any work around to this please? function OnddlChanged(dropdown) { if( dropdown != null) { var selindex ...

Can I make a non hosted HTML5 app with local storage?

I have a PHP/MySQL site I'm thinking about converting into a HTML5/JavaScript that could be run off of a users computer locally. I would like the user to be able to download my site, extract it and use it without a network connection. A static mirror of this site would hundreds of megabytes while the actual data is under 10 megabytes. Is...

Help, "this" is confusing me in JavaScript

Working with the JavaScript one of the confusing thing is when using this var x = { ele : 'test', init : function(){ alert(this.ele); } } However when dealing with multiple object and especially events context of this changes and becomes confusing to keep track/understand. So if anybody has better inputs/guidelines/thoug...

AJAX SlideShowExtender control with extra functionality

I want to create a slideshow similar to one on www.nbc.com, where it has control button for every image that you can use to move between pictures. They use flash , can it be done with asp.net and standard AJAX SlideShowExtender ? If not what can you suggest(please no 3rd party controls) ? (They also have animated text next to the image...

Opera localStorage ignores my existence check

if (localStorage) { var menushown = JSON.parse(localStorage.getItem("menuState")); if (!menushown) { menushown = menuDefaultState; } } else { menushown = menuDefaultState; } The above JavaScript fails in Opera 10.10. It complains that localStorage is undefined on the second line. This is true, but because o...

scrape html generated by javascript with python

I need to scrape a site with python. I obtain the source html code with the urlib module, but I need to scrape also some html code that is generated by a javascript function (which is included in the html source). What this functions does "in" the site is that when you press a button it outputs some html code. How can I "press" this butt...

My intensedebate plug in isn't working on a custom install

Embedded via iWeb because I decided to mock it up quickly. The buttons and/or functions are not responding at all: http://nomosolo.com/preview/Word_On_The_Street.html Any thoughts? ...

JavaScript createElement help

Hi, I have the following code: function JS_Utils_BuildModal () { var objModal = document.createElement("div"); objModal.setAttribute('id', 'Modal'); document.body.appendChild(objModal); } What I want to do is add to it and create a series of DIVS and P's with some content so that...

JavaScript live syntax highlighter

Do you know a good live syntax highlighter written in JavaScript? With live syntax highlighter I mean a WYSIWYG editor that can be included in HTML pages and that is able to highlight the code in real time. Like a Notepad++ but in JavaScript. I've already read this question: http://stackoverflow.com/questions/61655/are-there-any-javascr...

jQuery UI Dialog and Textarea Focus Issue

I'm working on a modal comment system using jQuery and jQuery UI, but I'm having some issues with focus. I have a series of divs inside the modal to switch between Login and Add comment, as below: <div id="modal" title="Loading"> <div id="modalContent"></div> <div id="modalLogin"> <div class="loginBox"></div> <div class="addComm...

Javascript - Grid of Checkboxes?

Hello all, I am about to start a task where I will have a grid of checkboxes which will allow users to select all of the checkboxes, some of them or none of them. I will also add a few conditionals where you can select a checkbox if you have selected the one above it directly and deselect them if the checkbox above has been selected. B...

ASP.NET Validation Summary: How to disable validator with JavaScript?

Hi! I want to disable a ASP.NET RequiredFieldValidator with JavaScript. Actually I'm using the following code: function doSomething() { var myVal = document.getElementById('myValidatorClientID'); ValidatorEnable(myVal, false); } This disables the validator. But my problem is, that I'm using a ValidationSummary. And this su...

jQuery events. Send information to an event where he was called

Hello everyone. What would be the best way to send a message to the click event to find out from where it was called?. $("#mybutton").click(function(ev){ if (called from funcion One or Two){ //my code } }); funOne = function(){ $("#mybutton").click(); }; funTwo = function(){ $("#mybutton").click(); }; EDIT: o...

"function foo(bar) { }" versus "foo = function(bar) { }"

function foo(bar) { // ... } and foo = function(bar) { // ... }; What is the benefit of one versus the other? The main benefit I see in the latter is not running into errors with a function name already being defined. However, there may be other benefits or drawbacks that aren't obvious. What are they (if any)? ...

How do I create a child class of Javascript's Function class?

I would like to create a Javascript class that I can use like so: var f = new myFunction(arg1, arg2); f.arg1; // -> whatever was passed as arg1 in the constructor f(); f instanceof myFunction // -> true typeof f // -> function I can treat it like a normal object, even adding the native Function object to the prototype chain, but I can...

Best way to GET the xpath and css selector of a specific element

Looking for the best way to GET the xpath and css selector of a specific element using jQuery or Extjs. To basically select a random element and traverse up the dom and retreive it's unique css selector or xpath. Is there a function that can do this already or does anyone have a custom function that can do this? ...

Getting Region Data of geolocation using Google Maps API

Is there an easy way to determine a point's region in the world based on it's latitude and longitude? I have an entry form that a user enters in their address (city, state, and country). I then geocode this into a point that I can use on a Google Map. However, I'd like to have it store the region of the point as well so I can use it f...

Ajax Form Validation Problem

I've got my form validation almost working but I can't seem to figure this last problem out. I'm trying to send back error messages and position them in their own div next to their relevant form fields. I've got an error message coming back in its own div, but when I try to send multiple messages back nothing happens, any thoughts? He...

How can I determine the mime-type of a document using javascript only?

I need to determine the mime-type of certain files that get returned from the service, I do not know their file extensions or what their type is before hand, basically we retrieve documents from the API like such: "http://site.com/getFile/BFD843DFLKXJDF" where the random text at the end is some file. <input type="button" value="Click Me...

jQuery incrementally count selected checkbox and deselected checkbox

Hi, I have an ASP.NET web form that has 6 checkbox. 1 checkbox is to call a Function to select all checkbox and show the message "You have selected" 6 "items" (in this case, 6 checkbox). If a user doesn't select the Select All checkbox, they can select or deselect other checkbox individually and the message will be "You have selected" #...