Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "hello";
- ?>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $("div.click_me").live('click',function(){
- $.ajax({
- type:"POST",
- data:null,
- url:"xyz.php",
- success:function(response){
- alert(response);
- }
- })
- });
- });
- </script>
- <div class="click_me"> CLICK </div>
- <script type="text/javascript">
- $(document).ready(function(){
- $("div.click_me").live('click',function(){
- res=xxx();
- alert(res)
- });
- });
- function xxx(){
- $.ajax({
- type:"POST",
- data:null,
- url:"xyz.php",
- success:function(response){
- res=response;
- }
- })
- return res;
- }
- </script>
- res = xxx();
- alert(res);
- $('div.click_me').live('click',function()
- {
- function alertCallback(x)
- {
- alert(x);
- }
- xxx(alertCallback);
- });
- function xxx(callback)
- {
- $.post('xyz.php', null, function (result)
- {
- callback(result);
- });
- }
- return res;
- $.ajax({
- type:"POST",
- data:null,
- url:"xyz.php",
- success:function(response){
- callback(response);
- }
- })
- return res;
- $("div.click_me").live('click',function(){
- res=xxx();
- alert(res)
- });
- $.ajax({
- type:"POST",
- data:null,
- url:"xyz.php",
- success:function(response){
- res=response;
- alert("abc");
- }
- })
- alert("xyz");
- return res;
Add Comment
Please, Sign In to add comment