javascript - My file name is the same as my menu name. jquery takes the file name when I click the menu name
问题描述
my file name is the same as my menu name.how jquery takes the file name when I click the menu name?
$(document).ready(function() {
$('#mySidenav > a').on('click', function () {
var linkText = $(this).text().toLowerCase();
$("#isi").load("./"(linkText),".html");
$.get("./"(linkText),".html", function(data) {
$("#isi").html(data);
});
console.log(linkText);
return false;
});
});
解决方案
$(document).ready(function() {
$('#mySidenav > a').on('click', function () {
var linkText = $(this).text().toLowerCase();
$("#isi").load("./"+linkText+".html");
$.get("./"+linkText+".html", function(data) {
$("#isi").html(data);
});
console.log(linkText);
return false;
});
});
推荐阅读
- c++ - 时间:2019-05-10 标签:c++sfml如何sierpinski triangle
- macos - 在 android studio macOS 中运行 pod install 时出错
- css - 如何在调整视口大小时保持元素位置
- typescript - 由于 ANSI,Jest 快照测试以相同的输出失败
- bluetooth - 网络蓝牙:想要在使用 navigator.bluetooth.requestDevice 时过滤制造商数据
- android - 在 Android 开发中使用相机时的 Handlers、Threads 和 Executors 的说明
- python - Python使用数据时间创建数据框
- java - 我们如何在使用 selenium-java 运行自动化时处理应用程序消息卡
- r - 将一维向量插值到 R 中指定的新大小
- python - 类协程的一部分不是协程。为什么?