Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Javascript inside of PHP

    I am trying to load some javascript at the end of my php file and it is not calling the functions. Would someone mind helping me please.

    Code:
    
    	mysql_close($db_handle);	
    
    ?>
    /* End of the php code.  only php code exists above this comment.*/
        <html>
          
    
        <BODY>
      <!-- Note: Include this div markup as a workaround for a known bug in this release on IE where you may get a "operation aborted" error -->
      <div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div>
      <script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
      <script type="text/javascript">
        FB_RequireFeatures(["CanvasUtil"], function(){
        FB.XdComm.Server.init(xd_receiver.htm);
        alert("hi2");
        FB.CanvasClient.startTimerToSizeToContent(); });"
        alert("Hi");
      </script>
        </BODY>
        </html>

  • #2
    New Coder
    Join Date
    Dec 2007
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts
    your source says

    src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php

    It should be .js not .php

  • #3
    New Coder
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Mirror_Image View Post
    your source says

    src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php

    It should be .js not .php
    That is the correct src. I inputed the http://static.ak.facebook.com/js/api...eLoader.js.php into the browser and I get the source file. without the .php it gives me *404.

  • #4
    New Coder
    Join Date
    Nov 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have rewrote the code to this and it corrected the issue. I am using AJAX also.

    Code:
    			</script>
    			<!-- Note: Include this div markup as a workaround for a known bug in this release on IE where you may get a "operation aborted" error -->
            <div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div>
    	</head>	
    
            <!-- used to display the results of the asyncronous request -->
    		<span id="span_result"></span>
            <body onLoad="sayHello();">
               
          <BODY>
    
            <div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div>
            <script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
            <script type="text/javascript">
              FB_RequireFeatures(["CanvasUtil"], function()
              {
              //You can optionally enable extra debugging logging in Facebook JavaScript client
              //FB.FBDebug.isEnabled = true;
              //FB.FBDebug.logLevel = 4;
              FB.init( 'xd_receiver.htm' ); //FB.XdComm.Server.init( 'xd_receiver.htm' ); also tried this
              FB.CanvasClient.startTimerToSizeToContent();
              });
            </script>
          </BODY>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •