my website has 2 frames that have to change all the time(main content, and news), so sometimes when I click on one link(from navigation), I want it to call two links for me(one of them changes main content, and one of them changes news). for exampe, how to I call two links from below in one click? <a href="index.php?news=hi">Hi</a> <a href="index.php?news=hello">Hello</a> I tried something like this but it doesn't work : <a href="index.php?news=hi" AND "index.php?news=hello">Hi and Hello</a> I also notice there is a way to use "Onclick" function to solve the similar problem, but it does not fit in my code. Please, help me if u know the answer. thank you
Bad solution Try <a href="index.php?news=hi" onclick="window.open('index.php?news=hello')">Hi and hello</a> P.S. Some browsers and security plugins block window.open method. P.S.S. Another solution - create hdden form with target=_blank <form id='my_hidden_form' method='get' action='index.php?news=hello' target=_blank> </form> and do onclick="document.getElementById('my_hidden_form').submit()" getElementById doesn't work in some browsers
I am sorry that i did not make my question clear. I am not opening any new page. Two links below are just opening two different sections in a page. <a href="index.php?content=hi">Hi</a> <a href="index.php?news=hello">Hello</a> again, how would I do that? thanks for replying
Maybe jQuery (JavaScript framework) can help you. After click you should send 2 AJAX requests and after that rebuild your web page (via jQuery, without reload).
You need to add into the PHP so it can take the second parameter, HTML will not get this done. As I said just add a second parameter to the link.
can you give me a more specific example about how to add a second parameter? I searched everywhere and still can't find a solution. it is still reading the first link; not the second link this is my code: <?php echo"<a href='index.php?content=a';'index.php?news=b'>click</a>"; ?>
amaroks, this code will trigger another screen to open, and i don't want that. two links of mine should open two sections in my window.
Two simpler methods: 1. use javascript. or 2. if using frameset, eg top frame & menu frame then change two html pages (page1.html & banner.html) at same time with one user click. Note the frames[] container. <li><a href="http://www.yoursite.com/page1.html" onclick="top.frames[1].location.href='banner.html'" target="mainFrame">page1</a></li> Best regards, Ked38