CSS3 PIE Forums
http://css3pie.com/forum/

Accessing PIE.htc from a different domain than the host doc?
http://css3pie.com/forum/viewtopic.php?f=3&t=108
Page 1 of 1

Author:  jonwolfe [ Thu Aug 12, 2010 10:00 am ]
Post subject:  Accessing PIE.htc from a different domain than the host doc?

Hi. First off, I want to give a huge thanks to Jason for writing this amazing piece of code, giving it to us, and working so hard to answer questions in the forums. Now to my issue...

I'm trying to use PIE with a hosted app (Shopify) that places all asset urls (images, css, js, htc, etc) on a cdn. So, while my html document's location may be at http://www.twelvedays.com, the PIE.htc file will be at a url like http://static.shopify.com/s/files/1/005 ... 1281106516.

So, in my html I'm calling PIE like so:

<!--[if IE]>
<style>
.my_crazy_div { behavior: url(http://static.shopify.com/s/files/1/005 ... 1281106516); }
</style>
<![endif]-->

Shopify is serving the .htc file with the correct content-type, but IE is giving me an "access denied" error when I load the page. I suspect this is due to the .htc file residing on a different domain than the host document. Has anyone come across this issue? I haven't been able to find many relevant articles when I google ".htc crossdomain" and such.

Also, btw, I've tried it without the ?128... query string (Shopify uses this as a cache-buster for updated files). That doesn't make a difference.

Thanks for your time.

Author:  Spudley [ Thu Aug 12, 2010 10:23 am ]
Post subject:  Re: Accessing PIE.htc from a different domain than the host

From other comments on this forurm, I gather that HTC behavior files cannot be loaded cross-domain. Sorry to be the bearer of bad news.

I wonder if you could use the PHP (or some other) wrapper to re-locate it within your domain?

Author:  jonwolfe [ Thu Aug 12, 2010 12:23 pm ]
Post subject:  Re: Accessing PIE.htc from a different domain than the host

Thanks for the reply. Yeah, it turns out you can't use .htc files on a different domain than the host document. Bummer.

Unfortunately I can't use the php wrapper with Shopify. I'll keep my eyes peeled to see if there's a pure-js alternative to the .htc file.

Author:  Spudley [ Fri Aug 13, 2010 3:10 am ]
Post subject:  Re: Accessing PIE.htc from a different domain than the host

jonwolfe wrote:
Thanks for the reply. Yeah, it turns out you can't use .htc files on a different domain than the host document. Bummer.

Unfortunately I can't use the php wrapper with Shopify. I'll keep my eyes peeled to see if there's a pure-js alternative to the .htc file.


Let us know what you find. Before PIE, I wasted a lot of time trying to find something suitable, but I every other solution I found has show-stopping problems.

As far as pure JS options go, the best I found are some JQuery solutions, but none of them completely worked for me.

I'm hoping that Jason will release a pure JS variant of the PIE HTC. I don't need it myself but I can see a few use cases where it would be good to have, and I don't suppose it would be too difficult for him (HTC files are just a wrapper for Javascript anyway).

Author:  jason [ Sat Aug 14, 2010 3:26 pm ]
Post subject:  Re: Accessing PIE.htc from a different domain than the host

Yup a pure JS version is in the works. It'll have some downsides to it (e.g. no automatic attachment/detachment) so the HTC will remain the preferred approach, but it should be a good option for many people.

Tracked here: http://github.com/lojjic/PIE/issues#issue/19

Author:  stoehr [ Tue Feb 04, 2014 7:01 pm ]
Post subject:  Re: Accessing PIE.htc from a different domain than the host

(Here is a MSDN page about this: "Introduction to DHTML Behaviors | Security".)

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/