javascript

Rotation webkit problem when spinning like a compass

this is my simple function ('mycompass' is a div in my body) function watchCompass() { var suc = function(a){ var r =a.magneticHeading; document.getElementById('mycompass').style.webkitTransform = "rotateZ("+-r+"deg)"; }; var fail = function(){}; var opt = {}; opt.frequency = 50; time...

jQuery, PHP: Calling a PHP script from jQuery, but it doesn't appear to be executing

Hi y'all! I'm using the source code found on this site here: http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/comment-page-1/#comment-2562 A fantastic resource, I think you'll all agree, but my problem is that my Javascript doesn't appear to be actually executing the PHP script... When I add a breakpoint in Ch...

How to compress data on asp.net and uncompress in javascript

Hi this is my first Question :) I need a lib or way to compress a data in asp.net (vb) with the algorit deflate but the result inflate in javascript. I'm use a lib in javascript: deflate.js hxxp://www.codeproject.com/KB/scripting/Javascript_binaryenc.aspx?msg=2904739 First i'm deflate and convert to base64 the result but the result is...

Is there a simple conversion for this datetime format?

I'm retrieving data from a JSON feed using jQuery and as part of the feed I'm getting 'datetime' attributes like "2009-07-01 07:30:09". I want to put this information into a javascript Date object for easy use but I don't believe the Date object would recognize this kind of format if I simply plugged it into the constructor. Is there a...

tiny mce spell checker

does any know if tiny MCE support spell checking? ...

jQuery find height of an image even if it is not set in the HTML

Hi, I have, what I think is, a strange issue. I am running a simple query that finds the largest image on a page. Here is some test data - all images are 32x32 but one is sized to 300x300. <img src="app/assets/images/icons/blue.png" /> <img src="app/assets/images/icons/error.png"/> <img src="app/assets/images/icons/info.png" height="30...

Javascript - access object member when identifier string is stored in a var

I've got a pretty simple question (and tentative answers), I just want to see if maybe there is a better answer out there. How can you access an object member in javascript when the member identifier is stored in another variable? Example: state = 'sync'; messages = { 'sync': 'asdf', 'ready': 'asdf', 'complete': 'asdf' }; Poss...

A better way to search for events?

I recently found myself in the situation that I needed to remove a function bound to the resize event of the window by WordPress' media manager (media-upload.js), because it was interfering with the proper use of Thickbox. The event is attached like this: a(window).resize(function(){tb_position()}) It took me a while, but I finally fo...

Prototype - form collections of prototype listeners and dom listeners

How do you form a collection of all the listeners and functions for a given Element using prototype? Also, is there a simple way to do this with normal Dom listeners on a given Element? thanks ...

jQuery is mousedown on mouseover

I have a table where i want to change cell background on mouse over and mouse button down, my current solution doesn't work as I want it to : function ChangeColor(sender) { sender.style.backgroundColor = 'yellow'; } var clicking = false; $(document).mouseup(function() { clicking = false; }); $(document).ready(function() {...

Changing the attribute of a tag with jquery

Hello, I have this html code that i want to edit with jQuery. Here is the html. <html> <head> <title>JQuery Problem 1</title> <script type="text/javascript" src="jquery-1.4.min.js"></script> <script type="text/javascript" src="problem1.js"></script> </head> <body> <ol> <li>Comp 250 <ul> ...

Toggle Forums on bbPress

Looking to add a toggle button to categories on a bbPress site, something like a + and - that will open and close the category box. Anyone done this with a bbPress site? I have the jQuery toggle in place just need a way of getting it to talk to the forum categories as the cats don't have unique ID's applied to them and I also need the t...

Finding places of interest, based on approx geo location.

Hi folks, I was wondering if it is possible to get the places of interest in a location based on the lattitude/longitude information or approximate street address gathered from a GPS system? places of interest are defined in this context as: Restaurants, Resorts, Parks, malls, movie theaters, etc. Are there some online services either...

Using Hover in JQuery when the mouse moves over a list item

Hello I have this list that i am working on. When i move the mouse over a list item i want to change the border color of the list item to red, and when i move the mouse off, it should change back to white. Here is my html <html> <head> <title>JQuery Problem 1</title> <script type="text/javascript" src="jquery-1.4.min.js"></...

Global Variable JavaScript (Changing Value)

Is it possible to change the value of a global variable in JavaScript? If so, is it possible to do it in a function called by an event listener such as "onreadyStateChange"? It's working for normal functions. but doesn't change when I call a function like this: <script.......> var dom1 = 3; function work() { ... ...

Documentation on <FIELDSET> <LABEL> tags instead of using TABLE's?

I've just come across these in MVC, and would like to use them instead of tables sometimes, as tables and DIV's just don't mix well! Never seen these before, and was wondering if there is any documentation about these new table-substitute TAGs? I've also heard recommendations to use these as opposed to tables and would therefore like to...

How do I force the browser to only handle the top link if 2 elements are clickable?

Say I have the following code: <div onclick='location.href="http://www.example.com/"'&gt; <a href='#' onclick='alert("blah")'>click</a> </div> Is there a way to only have the anchor evaluated when I click the 'click' text and not have the div's onclick evaluated? ...

Raphael JS library how to disable text shift on multi-line

Hello, By default when adding text object to paper Raphael javascript library centers text around y point. It basically takes the height and divides it by 2 and attaches text to the new y coordinate. I'm looking for a different behavior where text stays at the same coordinate even when you add multi lines. I was wondering if anyone ha...

Alternating background color of items in an unordered list

Hello, I have an Ul of item. I want to alternate there background color here is the html <html> <head> <title>JQuery Problem 1</title> <script type="text/javascript" src="jquery-1.4.min.js"></script> <script type="text/javascript" src="problem1.js"></script> </head> <body> <ol> <li>Comp 250 <u...

Google maps geocoding service

I am using google maps API geocoding service to get location's country name, postal code etc. JSON response: { "name": "1600 Amphitheatre Parkway, Mountain View, CA, USA", "Status": { "code": 200, "request": "geocode" }, "Placemark": [ { "address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA", ...