javascript

How do I properly create and manipulate checkboxes via javascript in Internet Explorer?

Hello, I'm writing a web app. Based on certain choices the user selects, it dynamically creates a number of checkbox input elements. For the sake of usability, they should be created in a checked state, and the user would uncheck the ones they don't want. I have the code working fine in Firefox. Unfortunately, I have to target IE 7....

How to find a function by function name

I need to find a function handler on the page by only using a function name. How can I do it in javascript? Thanks. ...

Check for bool in JavaScript

I've got the following jQuery (I've got it wrapped in the document ready function and all that, so please know I'm just showing you the inside of the function. .. var itemIsSold = $("#itemIsSold").val(); alert(itemIsSold); if(!itemIsSold) { ... } where itemIsSold is a hidden input...

Using jQuery to compare two arrays

Hi all, I have two arrays of JavaScript Objects that I'd like to compare to see if they are the same. The objects may not (and most likely will not) be in the same order in each array. Each array shouldn't have any more than 10 objects. I thought jQuery might have an elegant solution to this problem, but I wasn't able to find much onlin...

Regular Expression for ASP.NET ID Using Javascript

I am trying to extract the word "need" from this string. ctl00_ctl00_ContentMainContainer_ContentColumn1__needDont_Panel1 I have tried [__]([.]?=Dont) This is using javascript .match() I have even tried to use http://gskinner.com/RegExr/ but just can't solve this one. Thanks for the help! ...

How can I prevent Backspace from navigating back in javascript?

This works in IE, but I cannot get it to work in Opera or Firefox. I want to prevent Backspace from navigating away if and only if the current focus is the SELECT dropdown. <html> <body> <select id="testselect"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4<...

In javascript Jquery, how do I determine the position from the top to the current state...everytime someone scrolls?

How do you bind it so that when a user scrolls, I can know the "offset" from the top, in pixels? ...

jQuery extension (scope?) question

I have some confusion over a jQuery extension not working as I'd expect. I have the following function defined: $.fn.poster = function() { this.each(function() { self = $(this); self.click(function() { /* does stuff */ $.post(url, data, function(d, t) { handle_storage(d, t, self); }, "json"); ...

XML <-> JSON conversion in Javascript

Hi, Does anyone know of a good solution to convert from XML to JSON and then back to XML? I found two tools for jquery, xml2json & json2xml. Each of these works very well - however, the conversions they use aren't 100% consistent. Has anyone encountered this situation before? ...

How do I programatically scroll down the page?

When the page loads, I want to use Javascript/Jquery to automatically take the user to the 500px downwards. But it has to seem natural. How can that be done? ...

Is there a Jquery plugin that will do a Image Carousel/slideshow?

For example: Prev IMAGE1 IMAGE2 IMAGE3 IMAGE4 Next And then...when thee person clicks next, it will change to: Prev IMAGE5 IMAGE6 IMAGE7 IMAGE8 Next And ideally, it would have a "slide to the left" effect. Does anyone know if there is a JQuery plugin that does this? THanks! ...

cancel a submit in jquery?

Hi all, im doing a form validation and I want to validate the input fields when "on submit" if error Im using jquery.scrollTo to go to error: $('#form_inscripcion').submit(function() { //se traen todos los inputs del formulario var $inputs = $('#form_inscripcion :input'); $inputs.each(function() { var encontro_error = validar($(th...

Why does the firebug console keep saying "undefined" when I enter a json object?

Here is a short transcript from my firebug console: >>> var a = {"name": "bob"}; >>> a undefined name=bob >>> a.name "bob" >>> b = 10 10 >>> b 10 Why does firebug print "undefined"? Why on a and not b? Inquiring minds want to know. ...

Auto link specific words and phrases

Hi All! Can I use jQuery, another library or standard javascript to list a series of words and phrases that I would like to be auto linked? For example: Word / phrase 1: link to www.something.com Word / phrase 2: link to www.somethingelse.com Word / phrase 3: link to www.anotherlink.org And so on. Thanks in advance for your help! ...

What Site is a Good Example of JQuery

I have already checked stackoverflow. Their Jquery/Javascript code is cryptic. The variables are all one letter in length. So can you guys give a good website that uses JQuery well and follows good/best practices? I have already read many books on the subject. I would like to jquery implemented on a large scale. ...

Using GXmlHttp and Webservices

I'm trying to use GXmlHttp in the Google Maps API to call a Webservice of mine (myService.asmx?op=myMethod) and am not having luck. Is there a way to call this web method using this object? Some sample code: var request = GXmlHttp.create(); request.open("POST", "http://myDomain/MyServicee.asmx?op=MyMethod", true); Nothing comes back...

How do I find out the size of a browser application window including the border, header and footer?

I am looking to create a fullsize window using javascript but I am having difficulties trying to take the actual size of the window into account. I can get the resolution of the desktop but if I set the windows width and height to that value, it is not 100% correct as it does not seem to be taking into account the size of the border for ...

jQuery not appending a drag-and-drop to connected folders

Going for a sort-of Windows explorer-style drag-and-drop folder behavior here. The "// make chapter items droppable" block isn't working - specifically, it's not appending the draggable to the dragged folder's list. <html> <head> <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/jquery-ui-1.7....

Which is the best lightweight jquery plugin to make cross browser round corner without using image ?

Round corner should be compatible with all IE versions also. From one plugin i want to make round corner button, text input field, round corner tab, round corner div, round corner table etc. Although i use http://www.dillerdesign.com/experiment/DD%5Froundies/ but it has slow rendering in IE8 and i thought if I'm already using jquery l...

Push Webpages jquery

Is there a way to push pages on change rather than putting a timer on a webpage to refresh every x mins? I guess what Im trying to do is not refresh an entire page when only a portion of it may have changed. I have seen on FB when an update happens it has message saying new content available. Perhaps you could MD5 a page then when an up...