javascript

jqGrid with an editable checkbox column

When using jqGrid how do you force a cell to load in its editable view on page load aswell as when it is clicked? If you set up 'cell editing' like below, the check box only appears when you click on the cell. { name: 'MyCol', index: 'MyCol', editable:true, edittype:'checkbox', editoptions: { value:"True:False" }, cellEdit:true, Al...

Sending MIDI messages in a Web page

How can I play individual MIDI notes in a Web page? I know of two ways to do it: Write an ActiveX control. Then it only works on Windows. I used to write ActiveX controls a long time ago, but now nobody likes to install them. Write a Java applet. This is OK if the user already has Java installed, but many users disable applets. Th...

How do I target a jquery click function where identical links exist (ie within a php foreach)?

Similar to what Facebook does on its newsfeed, I want to allow commenting on numerous feed items, which I'm pulling via a php foreach statement. This is creating identical classes. So when I click .show_comments it activates everything. I went through SO and found something akin to what you see below...but it's not working for me. Ho...

How to pass a variable to webservice in $.ajax

I want to send a parameter to the webservice. The parameter needs to be a variable and not a fixed string.When I write the following code the webservice is called fine and is executed perfectly. $(document).ready(function() { $.ajax({ type: "POST", url: "JsonTestService.asmx/Test", data:"{'url':'http://www.cramster.com'}"...

How does GGeoXML access cross-domain XML files?

Google Maps's API object GGeoXML is able to access cross-domain XML files (usually KML or GeoRSS). It does not use XmlHttpRequest because it throws the "Access to restricted URI denied" exception (as it's supposed to). Also, it does not use Google's GXmlHttp wrapper because I've tried and it throws the same URI denied exception. So, GGe...

Please suggest a Good Javascript Book

Possible Duplicate: Good JavaScript Books? Hi All, Please suggest a Good Javascript Book(including JSON).Thanks ...

Dynamically arranging divs using jQuery

Hello, I have the following structure: <div id="container"> <div id="someid1" style="float:right"></div> <div id="someid2" style="float:right"></div> <div id="someid3" style="float:right"></div> <div id="someid4" style="float:right"></div> </div> Now someid is acually a unique id for that div. Now i receive an array which has a diffe...

Join 2 'threads' in javascript

If I have an ajax call off fetching (with a callback) and then some other code running in the meantime. How can I have a third function that will be called when both of the first 2 are done. I'm sure it is easy with polling (setTimeout and then check some variables) but I'd rather a callback. Is it possible? ...

Javascript onkeypress

I have a question regarding the onkeypress event on Javascript. Is it possible to detect Just Ctl key or Alt Key? At the moment if both Ctl and m are pressed the onkeypress event can trigger a click. Is it possible to do just Ctl key by itself? Looking forward to your comments ...

Merging associative arrays javascript

What's the best/standard way of merging two associative arrays in javascript? Does everyone just do it by rolling their own for loop? ...

Open up first Fancybox picture automatically

Upon clicking on a link, I am bringing in some images from a JSON get, and then when clicking on one of the pictures can get the gallery to appear, but I would like the first image to appear straight away, as an event once the JSON has been loaded. Is this possible? My code is: $("#json-get") .css("cursor","pointer") .click(fun...

Changing body element class in Opera

I have this script which basically toggles a bgColor class on and off so that the background changes to black on the first button click and then returns to the default empty class on the second click. What I'm trying to figure out is why, in Opera 9.64, on the 3rd click of the button, the background stays black and only the background ar...

Modulo in JavaScript - large number

Hi! I try to calculate with JS' modulo function, but don't get the right result (which should be 1). Here is a hardcoded piece of code. var checkSum = 210501700012345678131468; alert(checkSum % 97); Result: 66 Whats the problem here? Regards, Benedikt ...

Input type file size varies in Linux/ Windows

I have an input type="file" element with size="70" and width="522px". It looks and works fine in all browsers on Windows but in Firefox on Linux the input element is bigger than 522 pixels. Things I tried: max-width:522px but it doesn't work (Linux). setting size="52" and min-width:522px; looks fine in Linux but doesn't work on in Fir...

Which to learn first Java or javascript?

With the intent on becoming fluent on both to do a mix of web and application coding. Would one facilitate learning the other? ...

Loading Unicode Characters from XML and push into Form via AJAX

How can I load Unicode Characters (specifically a trademark symbol) from XML and push it into a Form via AJAX? When I push formelement.value += "\u2122" it works fine, but when I place "\u2122" into XML, load it via AJAX, and push it to the form element it does not work. Any ideas? Thanks ...

Javascript: Cancel/Stop Image Requests

I have a website that makes heavy use of Ajax. Occasionally I need to load large image files on the page for the user. My question is, when these large image files are being download, is there a way to stop them if, say, the user navigates away from the page displaying the image? Thanks. ...

Do I need server-end knowledge (e.g. Django, Rails), if I want to do Javascript, AJAX stuff?

Hi People, I am trying to get into web development, specially interested building the front-end, UI part of websites while learning JavaScript maybe with AJAX technology. (I have a UI, HCI background.) However, I have absolutely no previous knowledge about server-end web development either. To my understanding, frameworks like Django s...

Where should I include JS files

Hello, I have a PHP application in which there is a div container which includes the app which has been $_GET from the URL string. Currently, there are two applications which require TinyMCE, and one application which requires jQuery and jQuery UI. Question is, where should I include the files on the page? In the header, the page lo...

when i click on this textbox it gets big but when i click away how do i make it go back to normal?

i'm basically mimicking the share button feature on facebook with jquery and what im trying to do is when i click on the textbox area the textbox gets larger by height. and when i click away it should get back to normal. with the last piece of jquery the code doesnt work at all. what are my options in getting this to work? thanks. ps: ...