0
我有一个问题,应该打开另一个页面使用jQuery的特定部分的链接。 index.php文件的如何打开页面的特定部分使用jquery
简化视图:
<?php
if (!isset($a)) $a = '';
switch($a)
{
case 1:
default:
print('<div class"left">the left menu that contains links to specific parts of the page</div><div class="main">content of the page</div>');
break;
case 2:
echo "second part";
break;
case 3:
echo "third part";
break;
}
?>
在这个页面上我使用jQuery在“主” DIV来打开这个文件的某些部分。 当我点击左边的链接时,使用jquery,我可以在“main”DIV中打开“第三部分”的内容; 本页面的样子:
-------------------- ----------------------------------
| | | |
| the left menu that | | |
| contains links to | | third part |
| specific parts of | | |
| the page | | |
-------------------- ----------------------------------
我需要的是jQuery代码,将允许单击位于其他一些网页,将打开index.php文件与内容的部分链接,如图上面的例子。
现在,我所能做的就是打开的index.php的部分,其中“trird部位”是
----------------------------------
| |
| |
| third part |
| |
| |
----------------------------------
,但我无法打开左MENY,并在同一页主DIV使用其他页面的链接。我怎样才能做到这一点?
我使用的是第二页上jQuery代码是:
$('.prt').click(function() {
var adr=$(this).attr('rel');
window.open(adr);
})
HTML的链接:
<div class="prt" rel="index.php?a=3">link</div>
感谢所有的建议&指针