JAVAscript behaves differently when opened as file:// vs. from local web server
4 Message(s) by 2 Author(s) originally posted in javascript programming
| From: Nick |
Date: Wednesday, October 24, 2007
|
I have been tasked to figure out a way to communicate from a
JAVAScript /XUL
client to a
server , but without using a web server.I have been researching different possibilities, and I have come upon
<a href = "http://aflax.org">aflax
</a>, which is a
library for
imbedding flash in JAVAScript. So far I have been able to get it to
connect , but only if the server script is
run ning locally along with
the flash content and client. I am using the example of a chat
program at aflax.org -
http://aflax.org/examples/sockets/sockets.html
. you can see the example there but unfortunately the
demo doesn't
work, and Aflax forums haven't provided a response.1) Why should the
HTML file (with JAVAScript and Aflax) act
differently when it is
open ed as a file:// as opposed to on a
localhost web server? It doesn't connect to the server when I simply
open the file from my filesystem rather than being served it on a web
server. The
Firefox error console notes this error when I use the
filesystem method: __flash__argumentsToXML isn't defined . This
error isn't present when it is served from the web server, but a
google search does not yield any help for me - only the same
function
embedded in lots of other code.
2) If I run the web server locally and open the HTML file, but run
the server (simply a perl script), it also doesn't connect to the
server. Someone suggested this may relate to setting the
crossdomain.xml. I Set it the domains to *, and it still didn't
work. Because I am running it on a local LAN, i'm not even sure what
domain I'd put there.
If this is an inappropriate place to post, I apologize, but I'm really
grasping at straws here - I do not know if the problem is JAVAScript,
Flash code, Flash player settings, the Aflax library, or what. I did
go into the flashplayer settings here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html#118539
to allow this particular flash file to connect out to the Internet.
Thanks,
Nick
| From: Thomas PointedEars Lahn |
Date: Thursday, October 25, 2007
|
wrote in message:
I have been tasked to figure out a way to communicate from a
JAVAScript /XUL client to a server, but without using a web server.
I have been researching different possibilities, and I have come upon
<a href = "http://aflax.org">aflax</a>, which is a library for
imbedding flash in JAVAScript. So far I have been able to get it to
connect, but only if the server script is running locally along with
the flash content and client. I am using the example of a chat
program at aflax.org - http://aflax.org/examples/sockets/sockets.html
. you can see the example there but unfortunately the demo doesn't
work, and Aflax forums haven't provided a response.
Having seen the example on the Aflax homepage, that library doesn't strike
me as being written by an individual who knows how to employ
ECMAScript
implementations properly.
1) Why should the HTML file (with JAVAScript and Aflax) act
differently when it is opened as a file:// as opposed to on a
localhost web server? It doesn't connect to the server when I simply
open the file from my filesystem rather than being served it on a web
server. The Firefox error console notes this error when I use the
filesystem method: __flash__argumentsToXML isn't defined .
So it is not defined, and you've to find out why -- Read the Source, Luke.
This error isn't present when it is served from the web server, but a
google search does not yield any help for me - only the same function
embedded in lots of other code.
http://getfirebug.com/
I did go into the flashplayer settings here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html#118539
to allow this particular flash file to connect out to the Internet.
However, the ECMAScript implementation (here: JAVAScript) doesn't care
about Flash Player settings, and the Same Origin Policy forbids and
prevents that kind of access.PointedEars
--
Prototype.js was written by people who do not know JAVAscript for people
who do not know JAVAscript. People who do not know JAVAscript aren't
the best
source of advice on designing systems that use JAVAscript.
-- Richard Cornford, cljs,
<f806at$ail$1$8300dec7@xxxxxxxxxxx>
| From: Nick |
Date: Friday, October 26, 2007
|
On Oct 25, 1:42 pm,
Thomas 'PointedEars' Lahn
<PointedE...@xxxxxxxxxxx>
wrote in message:
wrote in message:
> I have been tasked to figure out a way to communicate from a
> JAVAScript /XUL client to a server, but without using a web server.
> I have been researching different possibilities, and I have come upon
>
<a href = "http://aflax.org">aflax
</a>, which is a library for
> imbedding flash in JAVAScript. So far I have been able to get it to
> connect, but only if the server script is running locally along with
> the flash content and client. I am using the example of a chat
> program ataflax.org -
http://aflax.org/examples/sockets/sockets.html
> . you can see the example there but unfortunately the demo doesn't
> work, andAflaxforums haven't provided a response.
Having seen the example on theAflaxhomepage, that library doesn't strike
me as being written by an individual who knows how to employ ECMAScript
implementations properly.
> 1) Why should the HTML file (with JAVAScript andAflax) act
> differently when it is opened as a file:// as opposed to on a
> localhost web server? It doesn't connect to the server when I simply
> open the file from my filesystem rather than being served it on a web
> server. The Firefox error console notes this error when I use the
> filesystem method: __flash__argumentsToXML isn't defined .
So it is not defined, and you've to find out why -- Read the Source, Luke.
The
reference to that function in the library / aflax.js file is all
there is. Adobe's docs do not show any help here either:
http://www.google.com/search?q=site%3Aadobe.com+__flash__argumentsToXML&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
About the only place I can find someone referring to this function
(and not simply listing some code) is here:
http://lists.deconcept.com/pipermail/swfobject-deconcept.com/2006-July/000794.html
.
So I still do not really know what to make of it - unless my opening
the file locally, some library or other file isn't being loaded,
which has the definition in it.
> This error isn't present when it is served from the web server, but a
> google search does not yield any help for me - only the same function
> embedded in lots of other code.
http://getfirebug.com/
> I did go into the flashplayer settings here:
>http://www.macromedia.com/support/documentation/en/flashplayer/help/s...
> to allow this particular flash file to connect out to the Internet.
However, the ECMAScript implementation (here: JAVAScript) doesn't care
about Flash Player settings, and the Same Origin Policy forbids and
prevents that kind of access.
I have downloaded firebug and will try to use that. I hadn't heard
of the Same Origin Policy, but according to this:
http://en.wikipedia.org/wiki/Same_origin_policy , it does not apply if
I am opening the file locally.
Thank you for responding, I'd appreciate any more direction here.
nick
| From: Thomas PointedEars Lahn |
Date: Friday, October 26, 2007
|
wrote in message:
wrote in message:
wrote in message:
I did go into the flashplayer settings here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/s...
to allow this particular flash file to connect out to the Internet.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
However, the ECMAScript implementation (here: JAVAScript) doesn't care
about Flash Player settings, and the Same Origin Policy forbids and
prevents that kind of access.
[...] I hadn't heard of the Same Origin Policy, but according to this:
http://en.wikipedia.org/wiki/Same_origin_policy , it does not apply if
I am opening the file locally.
Unless I have misunderstood you, you are trying to open a resource with a
http:// URI from a resource accessed with a file:// URI. The Same Origin
Policy forbids that and there is no
workaround other than in Geckos to lower
the UA's security settings via a user preference (which strongly recommended
against nowadays).PointedEars
--
"Use any
version of
Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from
<http://www.vortex-webdesign.com/help/hidesource.htm>
Next Message: If Statement
Blogs related to JAVAscript behaves differently when opened as file:// vs. from local web server
Graphic Design - Online Television: Robin Good Interviews Max Haot ...
This would be a big success for us, and then at that time we ll
open up the doors to everyone. So, going back to your question about the features, one of them is the audience participation, and we look at it
differently: we ll have a
...
Information Technology Manual - Basic Defination for layman
A Remote Reference Layer that can
behave differently depending on the parameters passed by the calling program. For example, this layer can determine whether the request is to call a single remote service or multiple remote programs as
...
hi how can host I add the contents of one array to another say a ...
that’d be a
java question anyway. not a php5 one. gfather, stop writing exploits. doesn’t turn up anything either. because you can’t do that with JS? read the entire section No, you cannot read the MAC with
JavaScript. um ok, so TML.
...
Ajax (programming)
Ajax relies on
JavaScript, which is often implemented
differently by different browsers or versions of a particular browser. Because of this, sites that use
JavaScript may need to be tested in multiple browsers to check for
...
Let me break internet this down even further Lets say I want a ...
It causes the field to
behave differently to how most inputs
behave. The specification says the value attribute is for a “default value” and “search here…” is not a default value. It’sa pain if
JavaScript is not available.
...
Leopard Features
Deploy your widget in one click. Dashcode organizes all the
files that make up your widget, including images, stylesheets, and
JavaScript. Adding new
files is handled automatically by the project manager. Widget Templates
...