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

SAJAX .. introduction help

banning
P: 42
please feel free to delete this... i am an idiot... here is my code that works in case anyone was curious as to what i was trying to accomplish...

Expand|Select|Wrap|Line Numbers
  1. <?
  2.     require("Sajax.php"); 
  3.  
  4.     function sayhi(){
  5.         return "Name: Tom / Age: 26";
  6.     }
  7.  
  8.     sajax_init();
  9.     // $sajax_debug_mode = 1;
  10.     sajax_export("sayhi");
  11.     sajax_handle_client_request(); 
  12.  
  13. ?>
  14.  
  15. <html>
  16.     <head>
  17.         <title>Multiplier</title>
  18.  
  19.     <script>
  20.  
  21.         <? sajax_show_javascript(); ?>
  22.  
  23.             function sayhi(result) {
  24.                 document.getElementById('canvas').innerHTML += '<p>'+result+'</p>';
  25.             }
  26.  
  27.         </script>
  28.  
  29. </head>
  30.  
  31. <body>
  32.  
  33.     <div id="canvas" style="border: solid 1px black; margin: 1em; padding: 1em;"></div>
  34.     <input type="button" name="check" value="Say Hi" onclick="x_sayhi(sayhi);">
  35.  
  36. </body>
  37. </html>
  38.  
Feb 7 '08 #1
Share this Question
Share on Google+
5 Replies


ronverdonk
Expert 2.5K+
P: 4,258
Could you please add some explanation / comments to this code. It would make it easier for our members to comprehend what exactly is going on and how it works.

moderator
Feb 24 '08 #2

banning
P: 42
Could you please add some explanation / comments to this code. It would make it easier for our members to comprehend what exactly is going on and how it works.

moderator

hey sorry i ended up dropping SAJAX and going with prototype/scriptaculous
Mar 5 '08 #3

ronverdonk
Expert 2.5K+
P: 4,258
Does this mean that this thread is closed?

Ronald
Mar 5 '08 #4

banning
P: 42
yea, do i have to do something special when a problem is solved or a thread i started is closed?
Mar 5 '08 #5

ronverdonk
Expert 2.5K+
P: 4,258
No, it's fine. Just that members know it is virtually closed.
See you around here.

Ronald
Mar 5 '08 #6

Post your reply

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