Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Ajax loading local files

I'm creating a desktop application that needs to be able to dynamically update content.

I need to ajax load a php file in resources folder, but unfortunatly the HTTPClient object doesn't support the app:// protocol.

Is there any other way I can do this?

Thanks,
Rory

— asked November 11th 2010 by Rory Gilchrist
  • ajax
  • desktop
  • dynamic
  • folder
  • httpclient
  • local
  • php
  • resource
  • xhr
0 Comments

3 Answers

  • Hello,

    You do not need the http protocol to update the content via 'ajax'.

    just include your php file like this:
    <script type="text/php" src="my_file.php"/>

    in my_file.php define a class or procedure to do whatever you want to do and to output the content that you want, and from html side, when your ajax event occurs (on click, or by timer, etc) just call that php function, and replace the content of your container with the output.

    — answered November 19th 2010 by Tinu Coman
    permalink
    0 Comments
  • Maybe you could use a hidden webview and try to access it's html property after is loaded. Not sure.

    — answered November 11th 2010 by Dan Tamas
    permalink
    0 Comments
  • I suppose I could do, but it just seems a bit of a bodge job.

    — answered November 11th 2010 by Rory Gilchrist
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.