小编aks*_*rma的帖子

web3 getAccounts无法解析

web3.eth.getAccounts()对我不起作用.下面的代码显示执行时的"错误"(被拒绝).我使用的是web3 1.0.0 beta-46.我正在学习Stephen Grider的教程视频并使用beta-26,是版本相关的问题还是我做错了什么?

const assert = require('assert');
const ganache = require('ganache-cli');
const Web3 = require('web3');
const web3 = new Web3(ganache.provider());

web3.eth.getAccounts()
    .then(fetchedAccounts => {
      console.log(fetchedAccounts);
    },() => {
      console.log("error");
    });
Run Code Online (Sandbox Code Playgroud)

ethereum solidity web3js web3-donotuse

2
推荐指数
1
解决办法
65
查看次数

在ajax php页面上的SQL查询

我想使用ajax在div中获取内容,在使用ajax访问的php页面上,我想使用另一个查询填充下拉选项,但它只是在选项之前关闭选择标记.

<select class="form-control data" data-t="integer" name='role'  required/>
  <option value="">--Select--</option>
  <?php

  foreach($con -> query("select id,name,permissions from role") as $role){
      ?>
      <option value="<?php echo $role['id']; ?>"><?php echo $role['name']; ?></option>
      <?php
    }
  ?>
</select>
Run Code Online (Sandbox Code Playgroud)

但这是我进入div的内容

<select class="form-control data" data-t="integer" name="role" 
required=""></select> 
<option value='1' >option1</option>
<option value='2' >option2</option>
<option value='3' >option3</option>
Run Code Online (Sandbox Code Playgroud)

php ajax

-1
推荐指数
1
解决办法
33
查看次数

标签 统计

ajax ×1

ethereum ×1

php ×1

solidity ×1

web3-donotuse ×1

web3js ×1