Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用DIV中指定的值追加URL_Url_Append - Fatal编程技术网

使用DIV中指定的值追加URL

使用DIV中指定的值追加URL,url,append,Url,Append,我知道URL的第一部分,但需要根据客户端在div中输入的内容唯一地定义最后一部分。例如: <!-- specify page name in the div --> <div id="client-entry">page-name</div> <div id="load-url">url loads here</div> <!-- load what is specified at the end of the url --&g

我知道URL的第一部分,但需要根据客户端在div中输入的内容唯一地定义最后一部分。例如:

<!-- specify page name in the div -->
<div id="client-entry">page-name</div>
<div id="load-url">url loads here</div>

<!-- load what is specified at the end of the url -->
<script>
$("#load-url").load("known-folder/"#client-entry.text()".html");
</script>

页面名称
此处加载url
$(“#加载url”).load(“已知文件夹/”#客户端条目.text()“.html”);

任何帮助都将不胜感激。

想法1:

为您选择的div指定一个属性(例如ajaxify

然后用客户机条目div具有的任何属性值加载下一个div

想法2:

您可以将客户机条目div中的输入用作 然后使用jQuery将输入的值作为

var-toLoad=$('client-input').val()

在加载代码中使用此值

$("#load-url").load("known-folder/"+toLoad+".html");

想法1:

为您选择的div指定一个属性(例如ajaxify

然后用客户机条目div具有的任何属性值加载下一个div

想法2:

您可以将客户机条目div中的输入用作 然后使用jQuery将输入的值作为

var-toLoad=$('client-input').val()

在加载代码中使用此值

$("#load-url").load("known-folder/"+toLoad+".html");

你的第二个想法正是我想要的。我唯一改变的是将.val改为.text,效果非常好。非常感谢。你的第二个想法正是我想要的。我唯一改变的是将.val改为.text,效果非常好。非常感谢。
$("#load-url").load("known-folder/"+toLoad+".html");