javascript

jQuery - Ajax returning error 500 on some posts.

I have some Ajax that has been working on a live site, now it has stopped working. The Ajax should be returning a page but is returning a 500 error (internal server error). The strange thing is I can navigate and post to the page the Ajax is calling, so the page is only not working via an Ajax call ($.post). Another strange thing is it...

How can I pass a parameter to the callback of a jQuery ajax request?

I need to pass extra variables to a jQuery, ajax callback function. For example, given: while (K--) { $.get ( "BaseURL" + K, function (zData, K) {ProcessData (zData, K); } ); } function ProcessData (zData, K) { console.log (K); } ProcessData() will report 0 every time (or whatever the last value of K ...

Use JQuery/JS to eagerly load a bunch of MIDI file URls and cache them to be played on demand

Is it possible to have a webpage where on buttonClick, JQuery goes fetches a certain few URLs to MIDI files, and instead of them playing automatically, they are played on demand ? <a href="bach.mid">Bach</a> <a href="beethoven.mid">Beethoven</a> I want to be able to eagerly fetch them into an array of objects and play them on demand....

Adding to localStorage Object (chaining)

Possible Duplicate: Chaining a function in JavaScript? I asked a similar question, but a lot of people were confused and a lot of comments that made no sense (like someone commented jQuery overload... and this has nothing to do with jQuery). So here's my question, how do I add to the HTML5 localStorage object and make a custo...

how to check if a file is gzipped or not in firefox/firebug

Hi I am using a compression library for my js and css files. However according to yslow the file that it generates is not gzipped but it should be. So I want to verify this myself but I don't know how. How do I do this in firefox or firebug? ...

What are my options for indexable local storage in the browser?

So I'm really digging using localStorage for web apps and it works great... if you need a key-value store. However, I also find that my storage needs include something that looks like database tables with primary key - foreign key relationships. I had hoped IndexedDB would shape up sooner, but I'm disheartened by the less-than-ideal so...

Performance implications of multiple GET calls vs. more complex POST/GET request to AJAX in JSON from a server

I'm working on a website where the frontend is powered by AJAX, interacting with the server in the ordinary RESTful manner and receiving responses as JSON. It's simple enough to manage POST, DELETE, and PUT requests, since these won't differ at all from a traditional approach. The challenge comes in GETting content. Sometimes, the clien...

Help using OAuth 2.0 with the Javascript jQuery API to integrate with Facebook

I'm trying to work with the JavaScript SDK and specifically the extended permissions to integrate into Facebook. Is there a decent example / documentation out there for this? So far I have only found the basic example provided in the SDK's /examples folder. http://developers.facebook.com/docs/authentication/javascript The example sh...

Javascript cursor replacement

I'm looking to use an animated cursor in JS. CSS custom cursors do not animate in most browsers. I have heard of people (can't recall who) doing this. They hide the regular cursor (by setting a transparent custom cursor), then create an image that follows the cursor in JS. Anyone have any better ideas to achieve animated cursors? Is th...

jquery pagination results page

So I created a google maps store locator and im using a jquery pagination to show only 5 results per page. It works. The only problem is that every time I hit search it duplicates the pagination. http://cl.ly/25df05cbe6676ff0cb7c code: function paginate(){ var page = 1; var itemsPerPage = 4; var prev = "Previous Results"; var next = ...

How do I check if the window has focus?

I'm trying to do something similar to this... if (window.onblur) { setTimeout(function () { DTitChange(name) }, 1000) } else { document.title = dtit } The window.onblur doesn't seem to be working though, is there something I can replace that with? ...

Javascript for full screen

hello, is there a javascript script that auto fullscreen mode the browser? example if you visit my site, the browser will auto fullscreen upon load.. ...

Javascript / jQuery - removing or replacing a stylesheet (link)

How can I do this? I tried $('link[title="mystyle"]').remove(); and although the element is removed, the styles are still applied to the current page (in both opera and ff). is there any other way? ...

Opacity and jQuery fadeIn/fadeOut in firefox extension

I'm having a hard time getting jquery fades and the opacity css element to respond to me in a firefox extension that I am writing. I am using FireFox 3.6. I'm pretty sure that these two problems are related. This code is not fading, it is simply popping on and off the screen after a four second wait: css_notify_div = { position: 'f...

How to remove an object from an array of objects in jquery?

I have this code: var pinpoints= [ { "top": 50, "left": 161, "width": 52, "height": 37, "text": "Spot 1", "id": "e69213d0-2eef-40fa-a04b-0ed998f9f1f5", "editable": true }, ...

lock all submit button before page fully rendered

may i know how to use jquery to lock all the <input type="submit/button" .. and only allow submit when page is fully rendered? ...

HTML5 Filereader and SQL Database Crashes Chrome

I'm not sure if I'm using incorrect syntax, but I am unable to read an HTML5 Web SQL database BLOB entry into a DataURL using the HTML5 Filereader API. Here, try it for yourself on Chrome Dev Channel: http://austin.99k.org/index.html Choose multiple files, then inspect the page and go to storage. You'll see that a database has been cr...

What am I doing wrong that I can't get JQuery to read my xml file into a DDL?

Trying to load data into a drop down list when a user selects one of two radio buttons. the bookGenres.xml file is in the same directory as my script. I'm out of ideas. XML: <?xml version="1.0" encoding="utf-8" ?> <Genres> <Fiction> <book>Sci-Fi</book> <book>Fantasy</book> <book>Horror</book> <book>Romance</book> ...

Anti Aliasing after rotating context&drawing image with canvas

After rotating a canvas context then drawing an image on it, I find out that the edges of the image becomes jagged.. like so: picture. Is there a way to enable anti aliasing so the edges look more smooth?? ...

disable all selectbox onchange

below is how i disable all submit button on click $('form').submit(function(){ // On submit disable its submit button $('input[type=submit]', this).attr('disabled', 'disabled'); }); how to disable all selectbox onchange easily for all selectbox in the page ...