473,729 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combining Two Scripts


Hello!

I came across two different scripts [mouseover and opening the new pag
in a sized window] that I wanted to combine, and I thought I wa
successful until I discovered a minor glitch.

What was happening was that the page that was linked to came out fine
but the page where the link was was linking out to another page [tryin
to direct to the site in my code].
Here's what my code looks like.
<html>
<head>
<!--
This file retrieved from the JS-Examples archives
http://www.js-examples.com
1000s of free ready to use scripts, tutorials, forums.
Author: JS-Examples - http://www.js-examples.com/
-->

</head>
<body>
<a href="Value="Op en Window
ONCLICK="window .open('http://www.geocities.c om/taintedrhapsody/tainted.html'
'Sample', 'width=600,heig ht=600')" onmouseover='sw itchImages("on" )
onmouseout='swi tchImages("off" )'><img name="imagename " src="taintx.gif
border="0"></a>
<script>// This creates an image object.
var preloadedImage1 = new Image();// This tells the web browser t
download this image now (rather than later).
preloadedImage1 .src="taint.gif ";
// This creates an image object also.
var preloadedImage2 = new Image();// This tells the web browser t
download this image now (rather than later).
preloadedImage2 .src="taintx.gi f";
function switchImages(_o nOff) {
if (_onOff=="on")// This replaces the image in the objec
"preloadedImage " and puts
// a copy into the document image object that was defined up above/
with the "img" tag.
document.imagen ame.src=preload edImage1.src;
else
document.imagen ame.src=preload edImage2.src;

}
</script>
</body>
</html>
What I want my page to do is:
1. The image that links to my main page have a mouseover effect.
2. Have my main page open in the sized window without error.
3. Have the page with the image NOT link or try to open a differen
site.

If someone could help me, I'd be really grateful

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message34382.htm

Jul 20 '05 #1
3 1476
Unregistered hu kiteb:
Hello!

I came across two different scripts [mouseover and opening the new
page in a sized window] that I wanted to combine, and I thought I was
successful until I discovered a minor glitch.

What was happening was that the page that was linked to came out fine,
but the page where the link was was linking out to another page
[trying to direct to the site in my code].
Here's what my code looks like.
Can you clarify that? A new browser window was opened, but it contained
the same page as the original page? Is that right?
<html>
<head>
<!--
This file retrieved from the JS-Examples archives
http://www.js-examples.com
1000s of free ready to use scripts, tutorials, forums.
Author: JS-Examples - http://www.js-examples.com/
One point: Ther are often problems when combining two pre-made scripts
on the same page without editing them. Common problems include variables
and functions with the same name. It is better to learn at least enough
to understand how the stuff you c&p works than to just copy it blindly.

Looking at your stuff below, I notice that the line breaking is a
complete mess. I'm not sure if this is a deliberate attempt to make it
hard to read, or if it is accident, or if it i an artifact of the
website you posted from.
</head>
<body>
<a href="Value="Op en Window"
Change that to

href=#

Thats still not the ideal solution acording to everyone on this list,
but it should leave you on the same page, and won't necessarily result
in an error. I'm curious. Did the original code for your javascripts say
to put that in the href attribute?
ONCLICK="window .open('http://www.geocities.c om/taintedrhapsody/tainted.h
tml', 'Sample', 'width=600,heig ht=600')" onmouseover='sw itchImages("on" )'
onmouseout='swi tchImages("off" )'><img name="imagename "
src="taintx.gif " border="0"></a>


The script tags should appear before any calls to that script appear. At
the point where you have " onmouseover='sw itchImages("on" )' ", the page
does not yet know that a switchImages() function even exists. This would
result in an error in a strict interpretation.

[snip code]

--
Fabian
This post is not associated in any way with forum4designers dot com.
Permission is specifically denied for that website to archive this post
or display it in any way.

Jul 20 '05 #2

I know that the whole script was confusing, but I'm not the greatest a
scripts, and I've only taught myself to tweak minor things in th
scripts. What I do is only out of trial and error so I'm not certai
on the changes I make.

Through your reply, I did manage to fix the problem, so I just wante
to say thanks

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message34382.htm

Jul 20 '05 #3
JRS: In article <bu************ @ID-174912.news.uni-berlin.de>, seen in
news:comp.lang. javascript, Fabian <la****@hotmail .com> posted at Mon, 19
Jan 2004 14:49:08 :-

Looking at your stuff below, I notice that the line breaking is a
complete mess. I'm not sure if this is a deliberate attempt to make it
hard to read, or if it is accident, or if it i an artifact of the
website you posted from.


AIUI, it is the website.

It has no business connecting to this Usenet newsgroup, and moreover is
evidently badly designed.

Those who wish to have questions answered in a Usenet newsgroup should
post them to that group using appropriate software.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - FAQish topics, acronyms, & links.
For news:borland.*, use their server newsgroups.borl and.com ; but first read
Guidelines <URL:http://www.borland.com/newsgroups/guide.html> ff. with care.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
3127
by: Mxsmanic | last post by:
How can I combine SSI, CGI, and PHP in Apache 2.x? I keep reading that this can be done, but I haven't found any examples of the actual configuration required to do it. What I want to do is: 1. Either pull the page from a file or generate it with a CGI program (depending on the individual URL, as usual). 2. Run the output from (1) above through the includes module so that SSI
2
2746
by: Brian | last post by:
Hi All, Can someone please point me in the right direction I am having problems combining JS and ASP. What I am trying to do is store in a database using ASP the referring page of my visitors. I got the ASP working great and when I use the document.referrer in an alert it works too, but when I try to combine the 2 languages that is when I get an error that I cannot fix. Here is the code fragment that is not working: rs("ReferPage")...
2
3275
by: Chris Mullins | last post by:
I've spent a bit of time over the last year trying to implement RFC 3454 (Preparation of Internationalized Strings, aka 'StringPrep'). This RFC is also a dependency for RFC 3491 (Internationalized Domain Names / IDNA) which is something that I also need to support. The problem that I've been struggling with in .NET is that of Unicode Code Points > 0xFFFF. These points are encoded into UTF8 using the Surrogate Pair encoding scheme that...
7
4817
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following capital letters all work correctly - B C D F G M S T with the diacritical marker &#_0775. Why am I having a problem with P?
0
1732
by: Edge | last post by:
I have two scripts I'd like to combine together. One is the Directory on my site listing profiles for bands, labels, promoters etc. The other script I have is a blogger that I would like to place into those profiles as a Journal for those users with profiles and also a acccess point so users can log in and make edits or updates to thier own profile. Dose anyone know how to do that? Each profile is listed under thier own id so I figure putting...
3
2368
by: Roger | last post by:
Hi there I have several bigger applications programmed with the old ASP (vbscript). A lot of data is stored in the session object. Now I have to extend the application with new functionality (-complete new part). My idea is to develop the new part in ASP.NET (C#) and leave the old parts in the ASP environment. With this way I can migrate the old code step by step into C# and I don't need to migrate the whole project in one step (-> I...
2
2188
by: peteinglastonbury | last post by:
I'd be most grateful if someone would help me. I hope I'm in the right forum (apologies if not) - I'm not sure whether my problem is CGI or Javascript related. I found a script called BatmoAudiopop.js which opens a pop-up browser window with an audio player when a link is clicked. Basically, it sets the right mime-type depending on the operating system and audio file type, then opens a window with the audio file (passed as a parameter) in...
5
5638
by: Tristan Miller | last post by:
Greetings. Is it possible using HTML and CSS to represent a combining diacritical mark in a different style from the letter it modifies? For example, say I want to render Å‘ (Latin small letter o with a double acute accent), but with the o in black and the double acute accent in green. Are either of the following valid? 1. <span style="color: black;">o</span><span style="color: green;">&#x030B;</span>
3
900
by: Mike Gleason jr Couturier | last post by:
Hi, I want to reduce the number of scripts (js) the client has to download . If I'm using validators and some other stuff, The page have 5-6 dynamic scripts.. Is it possible to tell the framework to combine all the scripts necessery to run the page into one?
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9427
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.