javascript

How do i make a allocation table?

I have build a grid of div's as playground for some visual experiments. In order to use that grid, i need to know the x and y coordinates of each div. That's why i want to create a table with the X and Y position of each div. X:0 & Y:0 = div:eq(0), X:0 Y:1 = div:eq(1), X:0 Y:2 = div:eq(2), X:0 Y:3 = div:eq(3), X:1 Y:0 = div:eq(4) etc.. ...

Inspect attached event handlers for any DOM element

Is there any way to view what functions / code are attached to any event for a DOM element? Using Firebug or any other tool. ...

Slickgrid, column with a drop down select list?

Hi I was wondering if anyone knows if it's possible to define a column in slickgrid as being a drop down select list. If not does anyone with some experience with slickgrid know how I should go about adding this option? Thanks ...

convert list of relative widths to pixel widths

This is a code review question more then anything. I have the following problem: Given a list of relative widths (no unit whatsoever, just all relative to each other), generate a list of pixel widths so that these pixel widths have the same proportions as the original list. input: list of proportions, total pixel width. output: li...

jQuery: NewBie Questions, how to call function from another class in jquery ?

I have function getCartItems in cart.js and I want to call that function in another class checkout.js than how can I do this ? ...

My AJAX is only firing once,

Hi There, I ahave some ajax that is fired when a checkbox is clicked, it essentially sends a query string to a PHP script and then returns the relevant HTML, however, if I select a select it works fine if I then slect another checkbox as well as the previous I get no activity what so ever, not even any errors in firebug, it is very cur...

How do I dynamically reference incremented properties in C#?

I have properties called reel1, reel2, reel3, and reel4. How can I dynamically reference these properties by just passing an integer (1-4) to my method? Specifically, I am looking for how to get an object reference without knowing the name of the object. In Javascript, I would do: temp = eval("reel" + tempInt); and temp would be eq...

JavaScript + Adding items into dropdown

I have two dropdowns in my JSP page 1. lstA test1 test2 test3 test4 2. lstB Now on selection of lstA, I want to populate all the items of lstA into lstB except the select one, also the content of lstA should remain the same. How can I achieve this? I tried to do it, but from lstA some random items get removed, w...

Using jqGrid with ArrayData and using the add, edit and delete buttons

I'm trying to get a basic datagrid for simple tabular input. The server will send the column information and render the corresponding table for the user to input records into and they post it back to the server. I'm trying to get jqGrid to just save the data as ArrayData and not use a database so I've done the following code to test it ...

Load external script dynamic, and access it, so I can trigger its domready function

I am trying to load the Zopim chat client. Normally it is included with a document write action. This causes it to be loaded before the domReady function is triggered, as it needs this to start itself. I want to load it later, and this works by using prototype (framework determined by Magento) to create a new script element and attachin...

Troubles with list "dropdowns" and which list item gets the dropdown

I'm working on a project for an MMO "guild" that gives members of the guild randomly generated tasks for the game. They can "block" three tasks from being assigned. The lists will look something like this: <ul> <li class="blocked">Task that is blocked</li> <li class="blocked-open">Click to block a task</li> <li class="block...

google maps api v2 - dynamic load (tens of thousands of) markers

Hello, how made with JavaScript+PHP+MYSQL and Google Maps API v2 dynamic load of markers? atm I have map follow example http://googlemapsapi.martinpearman.co.uk/infusions/google_maps_api/basic_page.php?map_id=8 but my marker_data_01.php (where are all markers listed -> look code of example) have atm 4MB and will only have more, an...

Validating existing JavaScript code (for more than checking entry). Example: Email and Particular Characters etc.

Hi, I'm wondering if someone can help me. I have recently used this tutorial: http://net.tutsplus.com/tutorials/php/create-a-signup-form-with-email-confirmation/ to develop a more complex sign up form for a competition for a client. Basically, the way the validation has been done is different to many other validation methods I've used ...

WebKit "Refused to set unsafe header 'content-length'"

I am trying to implement simple xhr abstraction, and am getting this warning when trying to set the headers for a POST. I think it might have something to do with setting the headers in a separate js file, because when i set them in the <script> tag in the .html file, it worked fine. The POST request is working fine, but I get this war...

Preferred method to reload page with JavaScript?

Hey Guys, which way to reload a current page (using a button) would you prefer? 1 <input type="button" value="Reload" onClick="history.go(0)"> 2 <input type="button" value="Reload" onClick="location.reload(true)"> 3 <input type="button" value="Reload" onClick="window.location.reload(true)"> 4 <input type="button" value="Reload" onClick=...

Google Maps: Map Type (Roadmap, Terrain)

I just came across the following web site and noticed they had 2 map types I'm not certain on how to activitate from the Google Maps JavaScript API. http://www.maps-for-free.com/index.html It's the "Relief" and "OSM" Map Type as found on the link above. Any ideas what the API call is to display "Relief" and "OSM" from a Google Map? ...

Pass client side js variable into server side jscript

How can I get the query string from the browser url using client side js and set it as a variable to use in some server side scripting? Client side script: var project = getQueryString("P"); function getQueryString(param) { var queryString = window.location.search.substring(1); splitQueryString = queryString.split("&"); f...

jquery plugin with multiple functions

According to the developer documentation jquery plugins are supposed to have only one namespace for all functions they make available. Which is straight forward as long as you only expose a single function per context (static/element). (function($){ var state_a = 0, $.myplugin = function(in_options) { // static ...

Giving an Error Object Expected Line 48 Char 1

Giving an Error Object Expected Line 48 Char 1------What did I do wrong??? *Note Line # are for reference only not on Original Web page****** <HTML><HEAD><TITLE></TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="Leslie Peer" name=author> <META content="Created with Trellian WebPage" name=descripti...

Can I disable Safari's smooth image scaling?

I'd like to scale some pixel-art images up in-browser. Because they're pixel art it looks horrible if image smoothing happens. In Firefox I can disable smoothing with "image-rendering:-moz-crisp-edges". In IE there's "-ms-interpolation-mode:nearest-neighbor"... which is the default scaling mode anyway, mostly. But I can't find a way t...