javascript

A quick question on data returned by jquery.ajax() call (EDITED)

EDIT: The original problem was due a stupid syntax mistake somewhere else, whicj I fixed. I have a new problem though, as described below I have the following jquery.ajax call: $.ajax({ type: 'GET', url: servicesUrl + "/" + ID + "/tasks", dataType: "xml", success : createTaskListTable }); The createTaskListTable funct...

Showing selected tabs differently with JQuery ajax tabs.

I had tabs with preloaded content like this: $(function () { $('div.tabs ul.tabNavigation a').click(function () { $('div.tabs ul.tabNavigation a').removeClass('selected'); $(this).addClass('selected'); return false; }).filter(':first').click(); }); This added class="selected" to links and css made sele...

Jquery get each div's sub child divs and grab info into an array

I have a some html that looks like this <div id="main"> <div id="sub_main_1" class="sub_main"> <input type="text" class="sub_name_first" /><br /> <input type="text" class="sub_name_second" /><br /> </div> <div id="sub_main_2" class="sub_main"> <input type="text" class="sub_name_first" /><br /> <input type="...

Access <body> tag properties from form found in mediaboxAdvanced lightbox.

I am building my portfolio website simply using HTML, Flash, and the Mootools Javascript framework. I have decided to implement a theme changing feature using Javascript and cookies. When the user clicks on the "Change Theme" link, a mediaboxAdvanced lightbox appears, containing a real-time form which allows you to change the theme on th...

Loading javascripts in ajax callbacks

Hello, Situation: I send an ajax request that returns HTML containing elements needing event handlers to be set on them. The code that sets the handlers for these elements is contained in a separate javascript file. I have been using the following code to load the required js files on callback by scripting the <head> tag. I have no...

Problem with onblur="submit" when using TinyMCE with JEditable

I'm trying to use TinyMCE together with JEditable, as per SamSpeak's blog post. I'm running into a small but annoying problem. I set onblur="submit" in JEditable's settings. The behavior I expect (and want) is that as soon as the user clicks away from the editor, the editor submits the new data (in my case, to a function). The problem ...

Show/Hide divs on radio selection

I have 3 divs that contain radio with labels and beneath each radio button I would like to show/hide a form based on whether the radio is selected or not. Code idea: <div id="radio1"></div> <div id="form1"></div> <div id="radio2"></div> <div id="form2"></div> <div id="radio3"></div> <div id="form3"></div> Using prototype does anyon...

1-letter names for variables and functions in jQuery, JavaScript

Hi there, I was looking at Twitter's static scripts and noticed that all variables and functions where just 1 character long, why and how do they do this? Has it something to do with performance? If so, why don't they give all elements on their website these kind of short names, maybe 2 characters long instead of 1 to avoid any collisio...

How to programatically select all text inside a TinyMCE editor

I'm looking for a way to programatically select all the content inside a TinyMCE editor instance. The reason I need this is that I'd like it if all the text inside the editor was selected, as soon as someone clicks on it (I'm using TinyMCE in conjunction with JEditable, by the way). Thanks, Edan ...

dynamically added HTML elements won't be affected by plugins !

there are plugins such as flowplayer overlay that asks to put a "rel" attribute to the HTML element to make it trigger certain events ... the problem is , when I create dynamically elements that have that rel attribute ,, they won't trigger it ... what is the solution for this !? ...

Problem with jquery-droppable in Chrome

I have a simple application that users jquery-ui's draggable and droppable. In Firefox, it works perfectly. In Chrome, however, I'm having problems. This is the code: $(".cell").droppable({ drop: function(event, ui) { var originalTarget = event.originalTarget; ... } }); In Chrome the 'event' obj...

Is JSON.stringify() reliable for serializing JSON objects?

I need to send full objects from Javascript to PHP. It seemed pretty obvious to do JSON.stringify() and then json_decode() on the PHP end, but will this allow for strings with ":" and ","? Do I need to run an escape() function on big user input strings that may cause an issue? What would that escape function be? I don't think escape ...

Finding the methods/properties on a swf object

I have a swf object embedded into a web page. Without having access to the source code of the swf file, how can I find the methods/properties that are exposed? For example... alert(document.getElementById('swfObject').id); ...returns a pop-up of "swfObject". And this... document.getElementById('swfObject').someMethod(); ...execu...

setTimeout(fun) with a single argument

The HTML5 specifications states that setTimeout can be run without the additional "timeout" argument which is supposed to say after how many milliseconds will the function "handler" be scheduled. handle = window . setTimeout( handler [, timeout [, arguments ] ] ) Schedules a timeout to run handler after timeout milliseconds. Any argu...

Why does it matter that in Javascript, scope is function-level, not block-level?

In the question http://stackoverflow.com/questions/1451009/javascript-infamous-loop-problem the accepted answer from Christoph's says JavaScript's scopes are function-level, not block-level What if Javascript's scopes are block-level, then would the Infamous Loop problem still occur? Or will there be a different (and easier) ...

Is there a flash or javascript Solari Board available for use on a webpage?

I'm working on a web page which will display information updated periodically via javascript. I want to have it displayed in a Solari Board, complete with the flipping tiles animation. Is there an existing Flash or Javascript implementation I can use? Here's my super-lousy javascript test for one letter. The solution should take a str...

Timing issue with jQuery and $(document).ready()

I have the following code block code when the document is ready: $(document).ready(function() { createDivs(); // creates some divs with class 'foo'; // iterate $(".foo").each(function(index) { alert(index + " - " + $(this).text()); }); } I find that the "iterate" part misses the divs I created in the createDiv...

Image resize handles in IE's contenteditable mode

How can I selectively turn off image resize handles in IE 7+'s contenteditable mode? I've tried setting the image's contentEditable to false and its onresizestart to "return false" to no avail. I'm using tinyMCE. ...

How do I save a file generated by an OS X Dashboard Widget?

I've got a web app that I'm porting to an OS X Dashboard widget. The web app generates some data on the client side using JavaScript, and then, when the user wants to save it, sends it to a server-side script which relays the data back with the Content-disposition: attachment; HTTP header, triggering a save-file dialog in most browsers. ...

Like live editing of XHTML and CSS in firebug can we do live testing of javascript without leaving page?

Like live editing of XHTML and CSS in firebug can we do live testing of javascript without leaving page? ...