473,394 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Add two script commands to the same HREF

21
Hi guys

I recently added a popup HREF script to a page, but I'd also like to make the page itself change when the HREF command is clicked. When the user clicks, not only would the popup window appear, but the originating page would change to another as well.

I thought it'd be a rather straightforward proposition, but I can't seem to get the syntax right. I tried using onClick and adding the second command after a semicolon, neither of which worked.

First, here's the HREF as it now appears:
<A HREF="javascript:newWindow4('play/ep01a.html')" onMouseOver="window.status='popup'; return true" onMouseOut="window.status=''; return true">

You'll notice that it calls an external script variable (newWindow4) which defines the nature of the popup.

Here are a couple of things I unsuccessfully tried to make the page change as well:
<A HREF="javascript:newWindow4('play/ep01a.html')" onClick="location.href='ep01.html'" onMouseOver="window.status='popup'; return true" onMouseOut="window.status=''; return true">

<A HREF="javascript:newWindow4('play/ep01a.html');window.location = "ep01.html"" STYLE="text-decoration: none" onMouseOver="window.status='popup'; return true" onMouseOut="window.status=''; return true">

Neither allows even the original script to run.

Basically, here' what I want it to do:
run newWindow4
change page to ep01.html

Any idea how I can make this link work?

Wolfman
Dec 8 '07 #1
2 2830
Logician
210 100+
Hi guys

I recently added a popup HREF script to a page, but I'd also like to make the page itself change when the HREF command is clicked. When the user clicks, not only would the popup window appear, but the originating page would change to another as well.
No matter how often you see it, script does not belong in the HREF parameter.

Expand|Select|Wrap|Line Numbers
  1. <a href='#' onclick='window.open("http://google.com","xxx","width=300,height=300");location.href="http://youtube.com"'>GO</a>
  2.  
Dec 9 '07 #2
Wolfman
21
Thanks much! I was able to succesfully combine the existing script with your syntax to result in the following line:

<A HREF="javascript:newWindow4('play/ep01a.html');location.href='ep01.html'" onMouseOver="window.status='popup'; return true" onMouseOut="window.status=''; return true">

It worked like a charm and allowed me to avoid a page refresh.

Wolfman
Dec 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: jasonbrown1999 | last post by:
Someone told me the following script could be used to run harmful commands on the server, by passing commands into the script. What the script does is encode an affiliate URL, create two frames,...
4
by: Tony | last post by:
I have a function that loops through a set of images but at the end of the loop I need the page to go to a new location. Does anyone know how force my page to go there. This is what I am...
7
by: ojsimon | last post by:
Hi I found this script on a forum and have been trying to make it work, but all it returns is a blank screen, i tried using the debug error reporting but got nothing from that either just a blank...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.