开发者

Adobe Air Javascript on *.php files

I'm trying to build an Adobe Air app which runs from a PHP file.

Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML.

My problem is that the *.php files contain JavaScript which in turn make use of Adobe Air code, specifically printing. I overwrite window.print to the Air version which works fine in HTML.

As soon a开发者_如何学Pythons the code is copied to the PHP file it doesn't even attempt to call it, yet other JavaScript works fine.


I read around a bit more and now know that Air will only run in a HTML page. Although there is no explanation that I could find that explains why this is...

How I think I can fix this:

My current idea is to add a RewriteRule in my htaccess to make PHP files accessible via a .html file extension. This should trick Air into thinking it's a HTML document, whilst the server is still able to process the PHP that is on the page.

When I get around to it, I'm more than happy to re-write the app to make it fully AJAX driven, which is what everyone else seems to be doing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜