I have an php script that is echoing JavaScript, in the JavaScript there are PHP variables
echo '<script type="text/javascript">
FB.init({
appId: "myid",
channelUrl: "//mysite/channel.html",
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
FB.getLoginStatus(function (response) {
if (response.status === "connected") {
FB.api("me/bookvote:download", "post", {
book: "<?php echo "http://mysite/auction_details.php?name=$item_details["name"]&auction_id=$item_details["auction_id"]";?>",
fb:explicitly_shared = "true" //? Is syntactically valid but creates a global
}, //Missing a , here?
However, I am still getting:
Uncaught SyntaxError: Unexpected identifier for book: http://mysite.xom/auction_details.php?name=$item_details["name"]&auction_id=$item_details["auction_id"]";?>",
What should I do?
<?php
inside php echo function. It should be likebook: "http://......'.$item_details.'...."
– netme Mar 21 at 23:01