javascript

how to save a sound object to local file for play later in adobe air ?

in my application , I want to download a mp3 file for remote server ,then play it . now I'd like to save the sound to local , for play it from the file later , just like a cache . I've tried to extract the raw data to a file when the sound object load complete , sound.addEventListener(air.Event.COMPLETE, function(event){ var cacheFileS...

jQuery code organization and performance

After doing some research on the subject, I've been experimenting a lot with patterns to organize my jQuery code (Rebecca Murphy did a presentation on this at the jQuery Conference for example). Yesterday I checked the (revealing) module pattern. The outcome looks a bit reminiscent of the YUI syntax I think: //global namespace MyNameSp...

Adding a class to an element in quirksmode

I try to add a class to a td-element using javascript with the internet explorer 8 in quirks-mode. That seems to work, because I can see the added class when I view the source, but my css doens't affect it so nothing visually changes at all. I simply add a html class to change the background-color but nothing happens. It works when runni...

Advantages of Ample SDK framework

Browsing the Internet, I found the new Ample SDK JavaScript framework. From their about section: Ample SDK is a standard-based cross-browser JavaScript GUI Framework for building Rich Internet Applications. It employs XML technologies (such as XUL, SVG or HTML5) for UI layout, CSS for UI style and JavaScript for application logic. It...

html parsing error unable to modify the parent container element before the child element is closed

Is there anybody that can help me please? sorry my english... this is the php code that generate the error (only on Internet explorer 8, on firefox, opera and chrome working good): <!-- SHIPPING ADDRESS --> <h4 id='onCheckoutShipping'><?php echo JText::_("Indirizzo di spedizione") ?></h4> <?php $baseurl ...

Can't fetch connection from javascript

When a user has logged in in javascript I'm trying to use that session in my actionscript-3 code. On connect my e(FacebookEvent).error.reason returns null though. Here is my code. stage.loaderInfo.parameters["fb_sig_session_key"] = getFlashVars().session_key; stage.loaderInfo.parameters["fb_sig_ss"] = getFlashVars().secret; st...

How can I send a form's contents over e-mail with JavaScript?

I've got a feedback HTML form, the results of which I need to send to an e-mail address. How do I do that in JavaScript? ...

Javascript: Greasemonkey access violation setValue

I'm trying to create a generic function that will execute piece of code on the NEXT reload of a page. This is called by onPageLoad({ onLoad: function() { code to call on next page load goes here } }); The only way I can see of doing this in greasemonkey is to set the whole onLoad: function as a string and set it via GM_setValue then re...

How to detect if start and end date overlaps another start and end date in JavaScript?

I got both a start and end date object on an event object. I got another object with the same start and end date objects in it. How do I test if they overlap each other? ...

How might you implement the interceptor pattern on client-side (browser) AJAX request/response pairs?

Let me start with a real-life use case: DWR is getting confused when server-side authentication filters attempt to redirect AJAX requests to the login page due to an expired session. You'd like to add some filters so that Requests whose HTTP status code equal 3xx execute a client-side redirect, like window.location = ...login.html Req...

Merge cells using javascript

I have googled merge+cell+javascript but did not find any suitable code to implement merge cells in a table. Is there any guideline by which I can make a feature like MS-WORD Table Cell Merge using javascript. Looking for your advice. Thanks. ...

how to create an "briefing" iframe on top of the page

Hi, The purpose is to let people embed my iframe at a certain size say 100*100, but then per user clicks this iframe should resize itself to the page size and back. This should be independent of the structure of the HTML embedding the iframe (if possible). Is it doable? Guy ...

Best way to return early from a javascript function normally returning a reference

Hi, Lets say we have a function of the form: function getReferenceToFoo( idName ) { if( ! document.getElementById( idName ) ) { return; } ... // else return reference to element normally } What is the best way to indicate failure by return type? By my mind I could do one of the following: Just 'Return' ...

Multiple popup windows using javascript

i am developing a chat application i need a javascript function to open seperate window for each online users now i am using following javascript code var myWindow; function openWindow(url) { var width = 700; var height = 500; var left = parseInt((screen.availWidth/2) - (width/2)); var top = parseInt((screen.availHeight/2) - (height/...

How to create Editable Dropdown List with Dictionary Option using JavaScript?...

Hi Guys, Eg:-- When I type "A" all the elements starting with A should be displayed... If "B" then elements with B....etc) Ex: <asp:DropDownList ID="ddlLocation" style="width:140px" runat="server"> <asp:ListItem Value="1" >India</asp:ListItem> <asp:ListItem Value="2" >India - Hyderabad</asp:ListItem> <asp:ListItem...

how can use a javascript variable as php variable?

hi, im trying to include javascript variables into php code as php variable but having problems doing so. When a button is clicked, the following function is called: <script type="text/javascript"> function addTraining(leve, name, date) { var level_var = document.getElementById(leve); var training_name_var = document.getEle...

Use Enter to Submit twice on the same page

I'm adding a extra functionality to an existing program. Its a Login page to manage the time a user came in and out. So first a login is asked, then (on the same page) a list with the login times are shown. The same button is used (just relabelled) for the login and time in/out. The problem exist when users want to use enter to login an...

Does something like Sprocket exist for Java

Sprocket is a Ruby library for managing JavaScript dependencies. It makes it possible to declare dependencies in specially formatted comments in the JavaScript files, and have all the required files concatenated server side. (Read more here: http://getsprockets.org/) Where I work, we have a real need for such a framework, but it has to...

Resizing street view object

Hello StackOverflow'ers, I have a (flex) app that, on the click of a button, resize a div (in javascript) at the bottom of the page and shows your position in google street view in it. The things is that if I open the browser at 80% of width, click on the button and then maximize the window, the div won't take 100% of width. I have a f...

Handling special characters in javascript

In the below code: var id=obj.setid({{info}}); I get an error saying illegal character and {{info}} has the following string: "Website® is registered " How do I handle this error in javascript? Thanks.. Edit: setid looks like this setid: function (id) { var obj = $(this) ; ...