2

Am I the only one having issues with the this?? I haven't got the exact code with me right now but it is something like the following... (this is the simplest of examples I am using to get up and running with TideSDK)

I have in my index.html...

<script>
    Titanium.include("testLibrary.php")
</script>
<script>
    var testresult = new testMethod();
    document.write(testresult);
</script>

And the testLibrary.php file that I have in my resources directory is as simple as...

<?php
    function testMethod()
    {
        $fixedResult = "The most basic php variable for display in the DOM";
        return $fixedResult;
    }

I have php switched on for packaging etc. It all worked fine when I included the php code within the index file so I know php is working, I just can't get include to work??

1 Answers1

2

Moving my comments to an answer, since not sure WikingFrog got notified via email re: comments

why are you calling new on the method? var testresult = testMethod(); should work

also, you don't need <?php open tag in .php files which maybe the source of your issue.

meeech
  • 1,396
  • 13
  • 21
  • Magic, thanks for the input. The 'new' came from following an example I found elsewhere, my bad. Will have a go without the php tags and see how I get on. – WinkingFrog Nov 10 '12 at 10:57