Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.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
Php 在newpage中打开单击的链接_Php_Jquery_Html - Fatal编程技术网

Php 在newpage中打开单击的链接

Php 在newpage中打开单击的链接,php,jquery,html,Php,Jquery,Html,我有这样的导航菜单索引页 man caps shirt jeans woman caps shirt jeans 现在我做了些什么,通过点击每个链接,比如说man的牛仔裤,文本通过jQueryAjax发送到服务器上的php,它检索所有man牛仔裤图像并将其发送回索引页面,清空主内容区域并在那里显示 现在,当我重新加载页面时,显示主页/索引页面的所有内容都消失了,会发生什么 我看到了Cookie,但不能为链接设置任何代码都会非常有用,如何设置Cookie来维护div中的

我有这样的导航菜单索引页

man
  caps
  shirt
  jeans

woman
  caps
  shirt
  jeans
现在我做了些什么,通过点击每个链接,比如说man的牛仔裤,文本通过jQueryAjax发送到服务器上的php,它检索所有man牛仔裤图像并将其发送回索引页面,清空主内容区域并在那里显示

现在,当我重新加载页面时,显示主页/索引页面的所有内容都消失了,会发生什么

我看到了Cookie,但不能为链接设置任何代码都会非常有用,如何设置Cookie来维护div中的一堆图像,然后当用户单击另一个链接时,说div中充满了caps图像,Cookie设置为该图像

我脑海中的另一件事是,当用户单击链接时,让页面显示products.html。该页面加载在具有类似标题的同一浏览器窗口中,页脚和导航菜单,但一个空的主要内容区域,当登陆此页面时,主要内容被点击的链接图像填充,因此,如果点击重新加载,它将保持在同一页面上,以摆脱cookies dragon,但无法为我的第二个想法编写代码

问候萨吉德

当他们点击“牛仔裤”(比如)时,你可以将页面设置为www.mysite.com/#Jeans。 刷新页面后,使用Javascript选择#jeans并加载相应的图像

虽然我不知道为什么你不能只使用cookies(尽管我必须承认我的眼睛已经累了)。


如果(window.location.hash==“graphicsDesign”||
window.location.hash==“somethingElse”){
loadContent(window.location.hash);
}

参考资料

我放弃了读那本书。请加上标点符号(包括大写字母、句号、逗号、撇号和段落分隔符)。哇,这真是一个连续不断的句子。请花一分钟把它分成可读的部分。你需要使用散列url,看看这个,希望它能帮助你@heera。请键入答案,然后让我标记它
 <a href="#graphicsDesign">Graphics</a>
 if(window.location.hash === "graphicsDesign" ||
    window.location.hash === "somethingElse") {
    loadContent(window.location.hash);
 }