我试图在我使用的URL中传递accesstoken和pageid的值。任何想法如何正确地做到这一点?

<script type="text/javascript">
function makeUrl() {
    var accesstoken = "12345679|bababashahahhahauauuaua";
    var pageid =  "<?php echo $page_id;?>";
 $.ajax(
  {
    url: 'https://graph.facebook.com/?pageid/?access_token='+pageid+accesstoken,
 statusCode: {......

最佳答案

改变

url: 'https://graph.facebook.com/?pageid/?access_token='+pageid+accesstoken,


url: 'https://graph.facebook.com/?pageid='+pageid+'&access_token='+accesstoken,

关于javascript - 如何在URL内传递Javascript变量? AJAX,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31321402/

10-10 00:15