dpz1983 2016-10-07 13:18
浏览 35
已采纳

传递值时出现语法错误[关闭]

I am trying to pass the value one form to another. I am getting ") missing" but I am not getting where I am going wrong. Is this the correct way to call all the parameters?

Uncaught SyntaxError: missing ) after argument list

$("#div1").load("http://ppp.gkdsjfgk.com/wp-content/themes/thestory/compare-form-site.php?loanamt=" + 
      <?php echo $_POST['loanAmt']; ?>."&occupation=" + 
      <?php echo $_POST['occupation']; ?>."&rateType=" + 
      <?php echo $_POST['rateType']; ?>."&age=" + 
      <?php echo $_POST['age']; ?>."&city=" + 
      <?php echo $_POST['city']; ?> );
  • 写回答

3条回答 默认 最新

  • douyun8885 2016-10-07 13:27
    关注

    You're using the wrong concatenator just after each of your PHP brackets ?>. The dot (the concatenator for PHP) should be replaced with + (the JavaScript concatenator) like this ?> +.

    $("#div1").load(
        "http://ppp.gkdsjfgk.com/wp-content/themes/thestory/compare-form-site.php?loanamt=" + 
        <?php echo $_POST['loanAmt']; ?> + "&occupation=" + 
        <?php echo $_POST['occupation']; ?> + "&rateType=" + 
        <?php echo $_POST['rateType']; ?> + "&age=" + 
        <?php echo $_POST['age']; ?> + "&city=" + 
        <?php echo $_POST['city']; ?> 
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?