Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Run 2 <A Href> commands from one button click (how to)

Posted on 2008-10-21
2
893 Views
Last Modified: 2012-05-05
I have the following 2 pieces of code :

<a href="scriptcode1:Browser(&quot;Browser&quot;,&quot;<SrcDir>\folder1\page1.htm&quot;)"><img id="Button1" class="inputImage" src="../button22-up.jpg" onmouseover="doRollOver(this);" onmouseout="doRollOut(this);" onmouseup="doClick(this);" onmousedown="doClick(this, true);" ondragstart="return false" onselectstart="return false">
</a>

and

<a href="scriptcode1:RunScript(&quot;s1&quot;)">

I need to run both at the same time so i need to fit the above (runscript) code into the one at the top (which works )
0
Comment
Question by:nathan1038
2 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 22772717
The way to open TWO LINKS AT ONCE (which is what I presume you are asking) is to follow this --

<a href="link1.htm" target="_blank" onclick="window.open(this.href,'one','');window.open('link2.html','two','');return false;">open 2 links</A>

You will have to adapt that to your needs, but the logic is simple --

The first is a link which when clicked opens a page in a new window.  The onClick() handler opens the second link in the original window, and by returning false, does not stop the main link opening.

Adapt that, and you are rolling.
0
 
LVL 6

Expert Comment

by:ysfx
ID: 22778207
You could include the second script in the first script... like the following:

<a href="scriptcode1:Browser(&quot;Browser&quot;,&quot;<SrcDir>\folder1\page1.htm&quot;);scriptcode1:RunScript(&quot;s1&quot;)"><img id="Button1" class="inputImage" src="../button22-up.jpg" onmouseover="doRollOver(this);" onmouseout="doRollOut(this);" onmouseup="doClick(this);" onmousedown="doClick(this, true);" ondragstart="return false" onselectstart="return false">
</a>

Hope that works
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question