doumowu7371 2015-10-26 03:51
浏览 47
已采纳

PHP语法中的JavaScript

I think this is a simple problem of my not knowing my syntax very well yet, but I am trying to get a js variable in a PHP, which actually happens to be in another js. I keep getting unterminated string literal error amoungst others general not working errors.

Code is as follows taking out the unnecessary

<script>
        jQuery(document).ready(function() { 
                var caNumber = document.getElementById("doc_id").value;                         
                var uploader = new plupload.Uploader({
                    url: '<?php echo admin_url('admin-ajax.php?project='.$_GET["project"].'&action='.$_GET["action"].'&number=caNumber') ?>'
                 });};
</script>

The problem in question is how to get the CaNumber in the url: where I have show CaNumber.

Thank you for time and assistance.

  • 写回答

4条回答 默认 最新

  • dongqiongzheng0615 2015-10-26 04:03
    关注

    You are merging both php and javascript. Keep them separate.

    url: "<?php echo admin_url('admin-ajax.php?project='.$_GET["project"].'&action='.$_GET["action"].'&number= ')?>"+caNumber;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 visionmaster启动失败,提示为“机器不满足授权而被禁用”
  • ¥50 用logisim设计16位单时钟周期cpu
  • ¥15 IDEA中圈复杂度如何具体设置
  • ¥50 labview采集不了数据
  • ¥15 请上面代码做什么处理或什么混淆
  • ¥15 英雄联盟自定义房间置顶
  • ¥15 W5500网线插上无反应
  • ¥15 如何用字典的Key,显示在WPF的xaml中
  • ¥15 weautomate读取Excel表格信息然后填写到网页一直报错,如何解决?
  • ¥15 C#如何在Webview2中获取网页验证码