![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 233 Pomógł: 0 Dołączył: 22.02.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witam, mam dwa skrypty js, które wywołuję w jednym pliku php przez echo.
W obu mam instrukcje if, które zwracają true. Ja chciałbym podsumować te 2 skrypty i w oddzielnym zrobić instrukcję: if (skrypt 1 funkcja1== true && skrypt 2 funkcja2==true){ cośtamcośtam } Jakim sposobem to zrobić ? |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 233 Pomógł: 0 Dołączył: 22.02.2010 Ostrzeżenie: (0%) ![]() ![]() |
Niestety cośtutaj nie gra (IMG:style_emoticons/default/sad.gif) :
Kod <?php
echo' <script src="http://connect.facebook.net/en_US/all.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script> <script> FB.init({ appId : "XXX", status : true, cookie : true, xfbml : true }); </script> <script> $(document).ready(function(){ FB.getLoginStatus(function(response) { if (response.status == "connected") { var user_id = response.authResponse.userID; var page_id = "XXX"; //coca cola var fql_query = "SELECT uid FROM page_fan WHERE page_id =" + page_id + " and uid=" + user_id; var the_query = FB.Data.query(fql_query); the_query.wait(function(rows) { if (rows.length == 1 && rows[0].uid == user_id) { return true; } else { $("#blokada").show(); //and here you could get the content for a non liker in ajax... } }); } else { // user is not logged in } }); }); </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId : "XXX", // should be replaced with your Facebook Application ID status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); }; </script> <script type="text/javascript"> function streampublish_popup(){ FB.ui( { method: "stream.publish", attachment: { name: "Demo Pulish To Wall With Popup And Call Back Function", description: ( "I have experienced with Share On Wall with Popup windows and would like to share with you. Check it now." ), href: "http://4rapiddev.com/facebook-graph-api/facebook-publish-to-wall-with-popup-or-dialog-and-call-back/", media: [ { "type":"image", "src":"http://4rapiddev.com/wp-content/uploads/2011/09/Example-Publish-To-Wall-With-Popup-Windows.jpg", "href":"http://4rapiddev.com/facebook-graph-api/facebook-publish-to-wall-with-popup-or-dialog-and-call-back/" } ] }, display: "popup" }, function(response) { if (response && response.post_id) { return true; } else { $("#blokada1").show(); } }); } </script> <script> if( function(rows) == true && function(response) == true ){ $("#filmik").show(); } </script>'; ?> Ten post edytował kiepski96 10.06.2012, 14:45:27 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 6.10.2025 - 00:19 |