javascript

how to call actionscript function from javascript

Hi all I have a function like this in actionscript3 private function uploadFile(event:MouseEvent):void { var uploader:URLRequest = new URLRequest(serverUploadFile); localFile.upload(uploader); } how can i call this function from javascript ? thx ...

Running an action when mousing over (and leaving) an element (or its child elements)

Imagine I have the following elements: +------------------+ | | | +----------------+ | | | | | | | +----------------+ | | +------------------+ The inner element has positioning that mean it can visually sit outside of its parent, and I put an event listener on...

Making JavaScript object member values more readable with a map

So I have this Omniture object. It's called s. s Inside s, we keep track of a bunch of information, inside "props" and "eVariables". s.prop5 = 'foo' s.prop22 = 'baz' s.var6 = 'bar' Which prop variables and which evars we choose to assign, depends on which page we're tracking. For example, on the homepage, we may wish to track p...

Javascript Split Array and assign values to variables from NZBMatrix API

Not sure if any of you guys/girls out there that uses the NZBMatrix website API.. In short what I'm trying to do is build an Adobe Air Application, using JavaScript, AJAX to connect to the API with a search query, this is all good. When i receive the "request.responseText" back from the API with the 5 results (can only be 5) I'm havi...

sIFR 3 - does getReplacementByFlashElement() or replaceText() work in IE6?

I'm currently running a Windows XP Pro VM using VirtualBox with IE6 standalone on it for testing purposes. I have noticed that neither of the text replacement methods appear to be working in IE6, however Safari/FF both handle things fine. I would like to know if this issue is pertinent to IE6 in general or am I just suffering from the ...

Ajax call to parent window after form submission

Hi all, Pardon the complicated title. Here's my situation: I'm working on a Grails app, and using jQuery for some of the more complex UI stuff. The way the system is set up, I have an item, which can have various files (user-supplied) associated with it. On my Item/show view, there is a link to add a file. This link pops up a jQuer...

exported json as string (not array)

Some have see that code : <?php echo stripslashes(json_encode(glob("photos-".$_GET["folder"].'/*.jpg'))); ?> it echo a really nice perfect string like that : ["photos-animaux/ani-01.jpg","photos-animaux/ani-02.jpg","photos-animaux/ani-02b.jpg","photos-animaux/ani-03.jpg","photos-animaux/ani-04.jpg","photos-animaux/ani-05.jpg","pho...

How to teach someone that less is more?

I work in a shop where the mentality/culture does not have any sense of the concept of "less being more" (i.e. the less code you have to maintain, the more flexible you can be, and the faster you can fulfill customer requests). There's also a strong copy-and-paste mentality around here. The backend code base being used is written in ra...

iframe designMode in firefox

I create iframe with designMode=on. When I open web site in IE and move mouse cursor on iframe, the mouse cursor get changes into text-cursor (big letter I). But when I open web site in Firefox, the corsur doesn't change and stays arrow-point cursor. How to fix that? <script language="javascript" type="text/javascript"> de...

How do I get the entire XML string from a XMLDocument returned by jQuery (cross browser)?

I have tried and failed to find out how to get the entire XML string from the XMLDocument returned by a GET. There are a lot of questions on SO on how to find or replace specific elements in the object, but I can't seem to find any answer to how to get the entire document as a string. The example I'm working with is from here. The "do s...

Analytics Tracking of a dynamic page

I am using Google analytics and wish to differentiate between two different cases on the home page, specifically depending on the user being logged in or logged out (similar to facebook). It was suggested to use a different URL for each page, but I am loathe to do at it involves modifying the website structure and involves needless redi...

Store some text persistently in a browser using Javascript

I am developing a Javascript library to FluidDB HTTP API. Since FluidDB API does not support JSONP I am forced to use AJAX and hence to develop a firefox extension to workaround AJAX's same origin policy. My solution is to include a HTML file inside the extension. That HTML file displays a simple form where the user could enter the u...

Developing Palm WebOS Mojo applicaitons with Google Web Toolkit GWT

Has anyone successfully developed a "native" Palm WebOS app using GWT? How do you setup your development environment and how did you interface with the mojo framework? I was thinking one setup might be to create 2 projects: a GWT & a Palm OS project. Setup your build to copy the results from you GWT compile into the Palm OS project. Pro...

why is this form still submitting after return false?

Hi... I am planning on showing/hiding divs to validate a form. But the divs only show a split second, and then the form gets submitted... Any ideas why? here is the code: function validateForm() { var name = nameEmpty(document.getElementById("annonsera_name")); if (nameEmpty(name)){return false;} return false; } function nameEmp...

How to work around the decimal problem in JavaScript?

Possible Duplicates: Strange problem comparing floats in objective-C Is JavaScripts math broken? 1.265 * 10000 = 126499.99999999999 ????? After watching this I discovered that in JavaScript: 0.1 + 0.2 === 0.3 evaluates to false. Is there a way to work around this? ...

ASP.Net: How to open a second window and write something in the mainwindow?

Hi guys, I want to open a window on a button click (favorite is ImageButton) and do some searches there. The search should be in a grid view and give the information back directly into a textbox. How is this possible? (best would be without javascript directly) ...

autofill a 3rd party textbox

Is there any way to automatically fill in a textbox on a 3rd party website via code on the referring page? My situation is thus: When a user clicks the pager number in our online phone directory, I've been asked to have that number filled automatically on the third party's site. They have no API. Certainly Javascript can fill in the...

Autocomplete: populate multiple fields based on selection.

Hi. I have a form, and there are 5 fields. The first field is an autocomplete field. I'd like to have the other 4 fields populated based on the autocomplete field selection. The docs in github ajax.autocompleter page reference setting an id and using a js function to call the id value, but this doesn't seem efficient if using multiple f...

ExternalInterface.addCallback is not working

Hi This is my AC3 code private function uploadet( dosya:String ):void { var uploader:URLRequest = new URLRequest(dosya); localFile.upload(uploader); } var a = flash.external.ExternalInterface.addCallback("uploadet",uploadet); And this is Javascript <script type="text/javascript" src="swfobject.js"></script>...

Convert from English Digits to Arabic ones in html page

I need to convert all English numbers that appear in a given HTML page to Arabic ones (to be independent from the user browser encoding). I prefer to use javascript or it will be great if this can be handled using CSS. I found some pages doing this but I found that the Arabic letters are added with their ASCII representation in the sou...