javascript

use an anchor to load a page sending post data

I'm not even sure if this is possible, but I need to send POST data to a page via a user-clicked link. Can this be done? To be clear, I do not want the data returned to the current page; the target page should load in the browser just as though the user had submitted a form, but I need to send the post data without a form, if possible ...

jQuery .add method seemingly not working!?

Hi there, I wonder if anyone can explain this: $(document).ready(function() { var popup = $('<div id="popup"><div class="popup-content"></div></div>'); var popupContent = popup.children('div'); var overlay = $('<div id="overlay"></div>'); console.log(popup); console.log(popupContent); co...

Zend Framework - Generate data in controller and pass to view for use in Javascript. How?

I have a bit of data that I want to use to build a form's select field. The JS that generates the form (it's part of the jqgrid plugin) is in the view. How do I get the data from the controller into the javascript so I can use it? To just get something working I tried the following... In the controller I created an action to return som...

Memory leaks on Firefox addons

I have an addon, which is pretty big, and I need to understand some things... What causes memory leak on a Firefox addon? How can I find what is causing the leak? How can I fix the leak? The addon adds some elements on the page, request parts of the page and update the DOM. The memory increases each time I reload the page, and the me...

Accessing REST Web Services through JavaScript

Hello Everybody. First of all. I want to say that i've acctualy read the other posts (like this) but, i don't think it's a good answer. I mean, what about all the status codes, and HyperMedia, etc. What about caching? What do you think? ...

jQuery: UI widget definition

I have a widget defined like so: $.widget("ui.mywidget", { _init: function() { this.element.bind("keyup", function(event) { alert(this.options); alert(this.options.timeout); }); } }); And trying to call it like so: $("input.mywidget").mywidget({timeout: 5}); I also redefined the bind ...

Why don't they implement python and ruby on the web browsers?

I wonder, why don't they implement other languages like python and ruby on the web browsers? Don't they fit as client programming languages or did it just happen to be that Javascript was the first one to be implemented, and they then kept on only supporting javascript because it just worked. I mean...I really hate Javascript compared ...

Looking for a good Javascript gallery manager

I've been looking around for ages, and have settled on Galleria. It's... useful I suppose. Can anyone suggest anything better? What I'm imagining is a gallery format much like this: http://www.lolitaagogo.com/illustration/illustration/ After a little research on her website it looks like it's some custom js built by squarespace. So usi...

Long-running CGI script hangs

I have a CGI script that takes a few minutes to run. I want to keep it very simple. Currently, it prints some information about the process and then starts running it. When complete, it shows the result of the job. It works perfectly when I load it in telnet. However, Firefox doesn't show the header information until after the proce...

How do I change HTML table cell color on click

Hi, I'm trying to change the background color of an HTML table cell when the user clicks on the cell. Any ideas on how to do this? I have access to the JS Prototype library, so any suggestions for Prototype or straight Javascript would be welcome. Thanks! ...

What actually breaks when updating from IE6 to IE7+?

We've heard for a long time that big companies won't upgrade from IE6 because some crucial legacy app was built specifically for IE6. Unfortunately the definition of "App", weather its a web app, desktop app, browser plugin(!), or something else is not specified. But what actually breaks when upgrading beyond IE6? I can't really think o...

What is the difference between $(this) and this

I have the following code $('a').click(function() { var url= this.href; alert(url); }); This works just fine and sure enough the returned result is the url of a tag. However if I change the above code to $('a').click(function() { var url= $(this).href; alert(url); }); The result is undefined. Anyone please help to clear this out ...

JQuery, GMaps and $('#myId') == getElementById("myId")

Hello. Why this isn't true? $('#myId') == document.getElementById("myId") I'm using JQuery 1.4.2 and trying to insert a GMap into an div element. So, this works: new google.maps.Map(document.getElementById("myId"),myOptions); but this doesn't new google.maps.Map($("myId"),myOptions); ...

How can I interpret a JSON object received as a string correctly?

Hi, I've got a broken web service that I can't access and alter. It sends down some mainly nice JSON, but one of the attributes is a nested JSON object that is being sent down as a string. http://www.ireland.com/api/getitemweb/185213 CustomJsonData in the response from the above url is the example. My question is how could I interpret...

Weird IE behavior: currentStyle returns null

I am experiencing weird behavior in IE8 which appears to be an IE bug but I am not sure. When accessing currentStyle field from an element it returns null. If I view its properties in the watch window I can see that it is defined and I can view its members. It appears that if I call attributes before hand then it will return the correct...

Javascript/jQuery: Why is the focus event not firing on an input field?

Hi I'm trying to attach a simple focus/blur event listener via the .live() jQuery method to my inputs but what I'm noticing is that the focus event is not firing whereas the blur event is. Strange… was hoping you may have an idea of why this is happening. Here is the code: function rowHighlight() { var form = $('form.register'), ...

Highcharts & Mysql

Hi, I need help with this code,I manage to extract data from a mysql database and convert them to a format required by Highcharts. <?php $query =mysql_query("select date_format(connect_time,'%Y-%m-%d %H %i') AS date, Customers.name as customer, Sum(duration) as secondes from CD...

Is there a good HTML5 and JavaScript beginners tutorial for making iPad web apps?

i am planning to develop a web app for iPad. Basically its e- catalog app. so my requirement is Intuitive UI (animation etc..) Support all touch gestures So my question is is there any good source of examples or tutorials for getting started with HTML5 and JavaScript? Thank you so much. UPDATE i just found about "Sencha Touch" any...

Examples of practical javascript object oriented design patterns

What object oriented design patterns do you use in your application's javascript, and why? Feel free to post code, even if there is no formal design pattern attached to it. I have written plenty of javascript, but I have not applied much object orientated patterns to what I am doing, and I am sure i am missing a lot. ...

jQuery voting system

So I am making a voting system, basically a Thumbs Up & Thumbs Down voting system. I am using CakePHP and jQuery with MySQL but want to make sure the front end is correct and this is the best way to do it. I want the user to be able to change their vote, so utilizing jQuery is this the best and most efficient way? I'm fairly novice wi...