简体   繁体   English

将锚标记添加到javascript URL

[英]Adding anchor tag to javascript URL

I have a PHP system and basically I use a popup lay to do some processing, ie upload an image. 我有一个PHP系统,基本上我使用弹出菜单进行一些处理,即上传图像。 No problems here and then on completing the insert and upload I go to a page which will call the underlying page and refresh it: 在这里没有问题,然后完成插入和上传后,我转到一个页面,该页面将调用基础页面并刷新它:

$callpage="jobsheet_build.php?id=".$_GET['id'];
echo("<script language=\"javascript\">");
echo("top.location.href = \" ").$callpage.("\";");
echo("</script>"); 

OK this works fine, but in the ideal world I would like to put a reference to #images in the $callpage so I end up with 好的,这工作正常,但在理想情况下,我想在$ callpage中引用#images,因此我最终得到

$callpage="jobsheet_build.php?id=".$_GET['id']."#images";

but the javascript just hangs no matter what I do. 但无论我做什么,javascript都将挂起。

Any ideas would be very greatly appreciated! 任何想法将不胜感激!

@Jim Have you tried to set the anchor tag like this echo("top.location.href = \\" ").$callpage.("#images\\";"); @Jim您是否尝试过设置锚标签,例如echo("top.location.href = \\" ").$callpage.("#images\\";"); instead of set the anchor tag inside the variable ? 而不是在变量内设置锚标签?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM