dongzhang7157 2019-07-28 15:01
浏览 150

echo使用document.write()通过class =“”传递变量

May I ask, why is it that this is not echoing any data? <input> receives a value of AAA-123-0001 by passing value in class="" (this is a modal:edit)

This line alone <input type="text" class="decid" id="decid" name="decid"> is working and displays the data that is being passed into the input box, but when I try to echo it, it wont.

<input type="text" class="decid" id="decid" name="decid">
<script type="text/javascript">
var abc = document.getElementById("decid").value;
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>

But, when I supply it with data directly via var, it echoes.

<script type="text/javascript">
var abc = "echo value";
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>

Also, when I try to feed the input box with data straight from value="", it works.

<input type="text" class="feed" id="`feed" name="feed" value="feed">
<script type="text/javascript">
var abc = document.getElementById("feed").value;
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>

The data is being passed through javascript

$(function(){
  $("body").on('click', '.edit', function (e){
    e.preventDefault();
    $('#edit').modal('show');
    var id = $(this).data('id');
    getRow(id);
  });

May I ask for a solution on this concern?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 对于squad数据集的基于bert模型的微调
    • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
    • ¥20 steam下载游戏占用内存
    • ¥15 CST保存项目时失败
    • ¥15 树莓派5怎么用camera module 3啊
    • ¥20 java在应用程序里获取不到扬声器设备
    • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
    • ¥15 Attention is all you need 的代码运行
    • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
    • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事: