By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

help in php and Sajax

P: 3
Hello ,
I get an error like this : 'object expected' . Can anyone please help ?
The code from the example is is as shown : I used Sajax library
Expand|Select|Wrap|Line Numbers
  1. <?
  2.     require("Sajax.php");
  3.  
  4.     function multiply($x, $y) {
  5.         return $x * $y;
  6.     }
  7.  
  8.     sajax_init();
  9.     // $sajax_debug_mode = 1;
  10.     sajax_export("multiply");
  11.     sajax_handle_client_request();
  12.  
  13. ?>
  14. <html>
  15. <head>
  16.     <title>Multiplier</title>
  17.     <script>
  18.     <?
  19.     sajax_show_javascript();
  20.     ?>
  21.  
  22.     function do_multiply_cb(z) {
  23.         document.getElementById("z").value = z;
  24.     }
  25.  
  26.     function do_multiply() {
  27.         // get the folder name
  28.         var x, y;
  29.  
  30.         x = document.getElementById("x").value;
  31.         y = document.getElementById("y").value;
  32.         x_multiply(x, y, do_multiply_cb);
  33.     }
  34.     </script>
  35.  
  36. </head>
  37. <body>
  38.     <input type="text" name="x" id="x" value="2" size="3">
  39.     *
  40.     <input type="text" name="y" id="y" value="3" size="3">
  41.     =
  42.     <input type="text" name="z" id="z" value="" size="3">
  43.     <input type="button" name="check" value="Calculate"
  44.         onclick="do_multiply(); return false;">
  45. </body>
  46. </html>
Oct 28 '08 #1
Share this Question
Share on Google+
1 Reply


Markus
Expert 5K+
P: 6,050
Littlecoder, please read the Forum Guidelines especially on How to ask a question. Use didn't use code tags. Please do so in future.

Also, may I ask how this involves PHP? I'm not sure it does; if you get a JavaScript error, then the error is JavaScript - not PHP.

I'll wait for your response and then move this thread if needs be.
Oct 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.