Expand my Community achievements bar.

Running external application with Javascript code from within Flex

Avatar

Former Community Member

I'm having a strange problem that I'm trying to solve and I cant seem to figure out why this is happening. I have a Flex Application doing an HTTPSERVICE request to an external .ASP file on the website. This file has code the executes and sends data back to the application. All that work fine but in the ASP file I have some Javascript code (website tracking script) that dont run when called from within the Flex App. If I run the ASP page by itself (out side from flex), the scripts run. Is it not possible to have the JavaScript run in the ASP when called from a Flex Application? Any help would be greatly appreciated.

Thanks,

John Baranowski

5 Replies

Avatar

Level 3

I think that's because the js is executed when the page is loaded in a

browser so probably you must try to tweak the js a little bit

Sincerely,

Michael

El 22/04/2009, a las 17:27, paranetrix5394 <forums@adobe.com> escribió:

>

I'm having a strange problem that I'm trying to solve and I cant

seem to figure out why this is happening. I have a Flex Application

doing an HTTPSERVICE request to an external .ASP file on the

website. This file has code the executes and sends data back to the

application. All that work fine but in the ASP file I have some

Javascript code (website tracking script) that dont run when called

from within the Flex App. If I run the ASP page by itself (out side

from flex), the scripts run. Is it not possible to have the

JavaScript run in the ASP when called from a Flex Application? Any

help would be greatly appreciated.

>

Thanks,

>

John Baranowski

>

Avatar

Former Community Member

So your saying that the Javascript should run in the ASP page when called from a Flex Application using the HTTPSERVICE?

Avatar

Former Community Member

Here is what I think is going on but I can't prove it yet:

The scripts are javascript based which are executed in the clients browser after a typical web page is loaded into a browser. So if you were to run the ASP file alone in a browser, the asp code executes server side then outputs the html code (including the javascript code) then the server sends that code to the clients browser and displays the html code and then the browser runs the scripts.

In the case of Flex or any ajax/web2.0 application, the application calls the .ASP file to be executed and the server does its thing the same as before but the code that the .ASP sends back to the browser never gets loaded into the browser but instead gets intercepted by the requesting flex application.


Can someone vouch for my thinking? I don't want to waste time trying to make this work if it cant.

Avatar

Level 3

I agree, the difference is that ASP is a dynamic page and it gets processed on the server, while JS is processed on the client, so when you request a page through Flex there's no client so that never gets trigger, I'll recommend you to add your own tracking, or if you find anything better please let me know.