...

View Full Version : Javascript inside of PHP



polexian
11-24-2009, 08:23 PM
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.





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>

Mirror_Image
11-25-2009, 01:07 AM
your source says

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

It should be .js not .php

polexian
11-25-2009, 04:18 AM
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_lib/v0.4/FeatureLoader.js.php into the browser and I get the source file. without the .php it gives me *404.

polexian
11-25-2009, 03:07 PM
I have rewrote the code to this and it corrected the issue. I am using AJAX also.



</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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum