Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-24-2009, 07:23 PM   PM User | #1
polexian
New Coder

 
Join Date: Nov 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
polexian is an unknown quantity at this point
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>
polexian is offline   Reply With Quote
Old 11-25-2009, 12:07 AM   PM User | #2
Mirror_Image
New Coder

 
Join Date: Dec 2007
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Mirror_Image is an unknown quantity at this point
your source says

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

It should be .js not .php
Mirror_Image is offline   Reply With Quote
Old 11-25-2009, 03:18 AM   PM User | #3
polexian
New Coder

 
Join Date: Nov 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
polexian is an unknown quantity at this point
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.
polexian is offline   Reply With Quote
Old 11-25-2009, 02:07 PM   PM User | #4
polexian
New Coder

 
Join Date: Nov 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
polexian is an unknown quantity at this point
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>
polexian is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:36 PM.


Advertisement
Log in to turn off these ads.