Menu

#5 Clent errors on basic example code

open-accepted
None
5
2004-10-25
2004-10-23
Anonymous
No

This is a follow-up to the quoting-problem bug-report.

Once I was able to get it where the server.php code I
got out of the documentation didn't die horribly, I
can't get the client to work. No matter how I slice
and dice the provided sample code, it _doesn't_ work
reporting errors like this:

Error: H.sayHello is not a function
Source File:
http://dev.nowhandling.com/ScriptServer/client.php
Line: 18

Unfortunately, the javascript that's kicked back from
the server runs screens wide and isn't that terribly
easy to troubleshoot.

Both are encountered running the latest version of
Firefox against the latest version of Apache/PHP
including with OS X 10.3.5.

My problem is that my current problem isn't complicated
enough to justify all this work...

Tim Wood
tim _dot_ wood _at_ datawranglers _dot_ com

Discussion

  • Harry Fuecks

    Harry Fuecks - 2004-10-25

    Logged In: YES
    user_id=569780

    "Error: H.sayHello is not a function" - note that when
    calling the remote PHP class methods from Javascript, thay
    should always be done it lower case (even if the PHP
    definition contains upper case chars).

    Hopefully later versions will get easier to get started
    with. The quoting issue _may_ be something connected to OS X
    and the linefeed chars in the sourcecode. Will look at that
    (don't have a MAC though so it's guess work).

     
  • Harry Fuecks

    Harry Fuecks - 2004-10-25
    • assigned_to: nobody --> harryf
    • status: open --> open-accepted
     
  • JLM

    JLM - 2004-10-25

    Logged In: YES
    user_id=456071

    Will try to solve your problem, cos I got the same.

    In the example code, a mispell in cases has been made. I
    talk about the javascript part.
    When you instantiate a PHP class or use PHP method from
    javascript, you need to type names in low case (that comes
    from the reflection functions in PHP 4, as written by Harry
    in the doc) :

    So instead of :
    ---------------
    var h = new helloworld(HelloWorldHandler);
    // Call the remote method
    H.sayHello(name);

    use:
    ----
    var h = new helloworld(HelloWorldHandler);
    // Call the remote method
    H.sayhello(name); // no more upper case !!!!

    Same note a few lines later in the HelloWorldHandler
    javascript structure:
    sayHello: function(result) {
    must become:
    sayhello: function(result) {

    And it should work..... That's not so complicated....
    A correction in the doc just should be done.

     

Log in to post a comment.