Js .innerHTML |内容错误以打开<section>内的链接

时间:2019-06-19 07:51:18

标签: javascript php html dynamic menu

情况:尝试使用js在某个部分内打开链接。

问题:我刚刚在打开了href文本。

我尝试使用.open().html().append()[etc]以及我在网上看到的所有解决方案。

index.php

CREATE TABLE orders (
    customer INT,
    id INT,
    total DECIMAL(20, 5),
    PRIMARY KEY (customer, id),
    CONSTRAINT fk_customer FOREIGN KEY (customer) REFERENCES customers
  ) INTERLEAVE IN PARENT customers (customer);

header.php

$menu = ['teste','Passus','Relacionamento','Servicos','Projetos'];
        $links = ['php/initial.','php/primeiroLayout.php'
                    ,'php/primeiroLayout.php'
                    ,'php/primeiroLayout.php'
                    ,'php/primeiroLayout.php'];

<header><?php include('php/header.php') ?></header>
<section id="section"><?php include("php/initial.php")?>
</section><footer><?php include('php/footer.php') ?></footer>

显示链接上的内容,但不打开页面;

1 个答案:

答案 0 :(得分:0)

Eu estava viajando !! Nem precisava de tanto esforco!

脚本不执行JavaScript,不执行最终的操作,请执行以下操作:coloquei onclick否执行菜单操作。 太!

header.php

菜单

<a onclick="carregar(' <?php print"$links[2]";?>')">test</a>

脚本

<script type="text/javascript">
    function carregar(pagina){
        $("#section").load(pagina);
}
</script>