javascript

Google Maps: Store locator

I am about to start designing a store locator for a business. I had a few questions on the best route to take. The main questions are located in bold. There will be two columns, 1 with the map itself and 1 with the list of all stores currently located in the view of the map. I am hoping to have the google map to be loaded zoomed onto a ...

DIV tags (fields) that change positions

hello, on my web form i have tree DIV tag fields. can you give me which is best way to enable that those fields can switch their positions, without refreshing form? i guess that with some javascript it's possible to do it? tnx in adv! ...

Why doesn't extjs qtip on combobox show up in internet explorer ?

hi all, I've added an extJS quicktip (qtip) to an extJS combobox and it works well in FF, Chrome, Safari but not in IE7 and IE8. Here is a code snippet: var searchConfig = { store: store, tpl: tpl, hideTrigger: false, minChars: 1, queryDelay: 50, emptyText: OpenLayers.i18n('Geo search.....

form select object dynamically changing class name with php and javascript?

Having some trouble here with this. The setup: A select object with a choice of "Other" User selects "Other". Script runs when this specific value is chosen, and dynamically changes the class of input object from "hide" to "show" (hidden and visible with css display). <p>Select a Grade:</p> <select name="grade" id="grade" oncha...

Download data url file

I'm playing with the idea of making a completely javascript based zip/unzip utility that anyone can access from a browser. They can just drag their zip directly into the browser and it'll let them download all the files within. They can also create new zip files by dragging individual files in. I know it'd be better to do it serverside,...

JavaScript and DOM: Why "<table>" += "<tr><td></td></tr>" += "</table" doesn't work?

In both of these, the string content is the same. If you do this: myDiv.innerHTML += "<table><tr><td>A</td><td>B</td></tr></table>"; You get a table with two columns. If you do this: myDiv.innerHTML += "<table>"; myDiv.innerHTML += "<tr>"; myDiv.innerHTML += "<td>A</td>"; myDiv.innerHTML += "<td>B</td>"; myDiv.innerHTML += "<...

Insert a string into an existing RegExp in Javascript?

Possible Duplicate: passing variable to a regexp in javascript I have a variable: resource = "user"; I want to insert that variable into a predefined RegExp (replacing variable beneath): /^\/variable\/\d+$/ How could I do that? ...

jQuery selectors - how to select elements on multiple criteria including the type of their "next" element

Using jQuery I need to select elements that are: under the "menu" DIV only AND are DT elements AND are followed by a DD element In this sample HTML I would only want to select ids "select_me1" and "select_me2" <html><body> <div id="menu"> <dl> <dt id="dont_select1"><a href="#">don't 1</a></dt> </dl> ...

Event Handler access context JavaScript

I have a question in JavaScript context. I'm a little confused by this issue. The code below describes my question: $(..).someFunction{ var outOfScope = "OUT OF SCOPE!"; $('somelink').click(handler); function handler() { alert(outOfScope); } } My question is: how outOfScope variable (which was defined outside the handler...

Javascript array loading value

I have 2 .js file, each contain the SAME large array or value (price list) Now i have to get the 2 array exactly the same... not good i like to have another .js file that will execute the array load into any function i like The way i approch the problem, i defining variable, and executing a function loading value into those... dont work...

How to display html content using Javascript or jQuery?

Currently I use iFrame to display third party content. For example, my news page displays live website from CNN, MSNBC, Foxnews in single page. Currently, I am just using iFrame to display those sites, but I was wondering if there is a better way to display the contents using Javascript, jQuery or other type of Javascript library? Tha...

Telling jQuery which (unique) div to do an action on

My plan is to have lots of boxes (an undefined amount). When show box is clicked under a box, it shows that particular box. I have some unique divs in my html. The div is made unique by: <div id="box-<%=box.id%>"></div> In my application.js, I have $('.show-box > a').click(function(){ $('#box').show(); }); I obviously need to have...

Firefox popup locks up parent until it's closed

I have a page where I open a popup window and the original window is supposed to stay usable. In IE and Chrome, I can switch back and forth between the parent and child, but in Firefox, if I click on the parent window, focus goes to the child (which just flashes tauntingly). I look at Firefox's popup options, and the only one that seeme...

RIA Technology of Choice

I'm looking into creating a Rich Internet Application. For the interface, I want something smooth, fast, and robust. I realize there are several technologies out there to do just that (Flex, standard HTML/Javascript, Silverlight). After using Grooveshark, I am very impressed with its interface (written in Flex). Personally, I don't thi...

setTimeout on form submission returning 'not a function' error

I have the following: var thiscode = { init: function(){ jQuery('#submit').bind('click',thiscode.clickListener); }, clickListener: function(event){ setTimeout('document.myform.submit()',5000); return false; } }; thiscode.init(); setTimeout is working, but when it fires, I get this: "document.myform.submit is not a functi...

On state select change country

Hello, I have two lists (one of states) and one of (countries). I want to have it so when a user selects Alberta it sets the country to Canada, and so on and so forth. I have the following javascript var states = new Array(12) states[0] = "AB"; states[1] = "BC"; states[2] = "MB"; states[3] = "NB"; states[4] = "NL"; states[5] = "NT"; ...

How to let a GXT grid take up all available width?

I have a grid in GXT, something like this: List<ColumnConfig> configs = new ArrayList<ColumnConfig>(); ColumnConfig config = new ColumnConfig(); config.setId("type"); config.setHeader("Type"); config.setWidth(50); configs.add(config); config = new ColumnConfig(); config.setId("text"); config.setHeader...

javascript array parameter list

Possible Duplicate: Calling dynamic function with dynamic parameters in Javascript I have an array representing the parameters I need to pass to a function call. How can I construct this function call dynamically? e.g. function constructRequest(params) { //params is an array of params to be sent to myFunction() myFun...

Build automation and deployment for Javascript

Hi everyone, i work at the digital department of a public broadcaster, together with two other frontend developers. We're currently looking into improving our Javascript workflow and build processes. Stuff like packaging, minifying, versioning, etcetera. In an ideal scenario, we would have a global repository for all Javascript-related...

Get name of field being passed

Hello, I have two sets of lists (state lists) One called state_o and one called state_d and I have a function I do on them function selectCountry(sel) { document.getElementById("country_o").selectedIndex = states[sel.value]; } Now what I want to do is determine if the "sel" is state_o or state_d and change the getElementById("cou...