Solved

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

Posted on 2008-10-21
2
890 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
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 basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

831 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