?
Solved

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

Posted on 2008-10-21
2
Medium Priority
?
908 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
[X]
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
2 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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)
Suggested Courses

752 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