Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6227 > unrolled thread

Unable to make ironpython run in browser with silverlight

Started byErichCart ErichCart <erichcart@gmail.com>
First post2011-05-25 05:16 -0700
Last post2011-05-25 19:07 -0700
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Unable to make ironpython run in browser with silverlight ErichCart ErichCart <erichcart@gmail.com> - 2011-05-25 05:16 -0700
    Re: Unable to make ironpython run in browser with silverlight ErichCart ErichCart <erichcart@gmail.com> - 2011-05-25 06:33 -0700
    Re: Unable to make ironpython run in browser with silverlight Jimmy Schementi <jschementi@gmail.com> - 2011-05-26 00:44 +0000
      Re: Unable to make ironpython run in browser with silverlight Sunny <gvagif@gmail.com> - 2011-05-25 18:59 -0700
      Re: Unable to make ironpython run in browser with silverlight ErichCart ErichCart <erichcart@gmail.com> - 2011-05-25 19:07 -0700

#6227 — Unable to make ironpython run in browser with silverlight

FromErichCart ErichCart <erichcart@gmail.com>
Date2011-05-25 05:16 -0700
SubjectUnable to make ironpython run in browser with silverlight
Message-ID<715e82a9-3761-4d82-9df4-1c5f39633160@h36g2000pro.googlegroups.com>
Basically i am following this tutorial:
http://blog.jimmy.schementi.com/2010/03/pycon-2010-python-in-browser.html
According to it, this code should run fine:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
  <script type="text/javascript"
          src="http://gestalt.ironpython.net/dlr-20100305.js"></
script>
  <script type="text/python" src="http://github.com/jschementi/
pycon2010/raw/master/repl.py"></script>
  </head>
  <body>
    <script type="text/python">
      window.Alert("Hello from Python!")
    </script>

  </body>
</html>

And in fact, it does, for example here: http://ironpython.net/browser/examples/pycon2010/start.html

You will see it if you have silverlight installed.

But the problem is that when I try to make the same code run on my PC,
I can't do it. I create a text file, copy this code there, save it as
test.html, and run with firefox, but nothing happens. Code does not
execute, i just get a blank page. I can't understand the reason why
the same code runs here: http://ironpython.net/browser/examples/pycon2010/start.html,
but not on my PC, given that it is a client side code, and not the
server side.

And there is nothing written in firefox error console, when I run it
locally.
But if I host it on my webhosting account, then I get this error:

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://
sitename .com/silverlighttest.html :: DLR_DownloadResource :: line 15"
data: no]

I uploaded the html file I am using here: http://www.filedropper.com/silverlighttest
But it just a text file with that code with extension changed
to .html.

What can I do?

[toc] | [next] | [standalone]


#6241

FromErichCart ErichCart <erichcart@gmail.com>
Date2011-05-25 06:33 -0700
Message-ID<b5c9c467-dbea-41df-9e18-1307ad6db2ed@d19g2000prh.googlegroups.com>
In reply to#6227
Here is how it looks on free webhosting account:

http://silverlighttest.zzl.org/silverlighttest.html

It is supposed to show a window with "Hello from python", but it shows
smth else completely.

[toc] | [prev] | [next] | [standalone]


#6284

FromJimmy Schementi <jschementi@gmail.com>
Date2011-05-26 00:44 +0000
Message-ID<2011525204432usenet@terrranews.com>
In reply to#6227
You need to run it from a web-server; it doesn't work when running from file:// due to Silverlight's security sandbox. Read the comments on my blog-post, it mentions the web-server there.

[toc] | [prev] | [next] | [standalone]


#6287

FromSunny <gvagif@gmail.com>
Date2011-05-25 18:59 -0700
Message-ID<73261820-78c6-4448-a75b-019c197f9832@f31g2000pri.googlegroups.com>
In reply to#6284
On May 26, 9:44 am, Jimmy Schementi <jscheme...@gmail.com> wrote:
> You need to run it from a web-server; it doesn't work when running from file:// due to Silverlight's security sandbox. Read the comments on my blog-post, it mentions the web-server there.

I see..
But here: http://silverlighttest.zzl.org/silverlighttest.html , it
runs from a web server, but still gives error.
And it has the same source code as your example, except that I replace
repl.py with the direct link, as you advise on your blog.

I think the problem is with this part:
<script type="text/python" src="http://github.com/jschementi/pycon2010/
raw/master/repl.py"></script>

Because when I delete it, it runs properly.

Do you know why is that?

[toc] | [prev] | [next] | [standalone]


#6289

FromErichCart ErichCart <erichcart@gmail.com>
Date2011-05-25 19:07 -0700
Message-ID<22405da5-439d-42be-8f2d-65090d3e5679@22g2000prx.googlegroups.com>
In reply to#6284
On May 26, 9:44 am, Jimmy Schementi <jscheme...@gmail.com> wrote:

> You need to run it from a web-server; it doesn't work when running from file:// due to Silverlight's security sandbox. Read the comments on my blog-post, it mentions the web-server there.

I see..
But here: http://silverlighttest.zzl.org/silverlighttest.html , it
runs from a web server, but still gives error.
And it has the same source code as your example, except that I replace
repl.py with the direct link, as you advise on your blog.

I think the problem is with this part:
<script type="text/python" src="http://github.com/jschementi/
pycon2010/
raw/master/repl.py"></script>

Because when I delete it, it runs properly.

Do you know why is that?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web