473,327 Members | 2,074 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,327 software developers and data experts.

Need debugger to help me

I am in no way a scripter/programmer of any kind but I am in charge of
a number of online videos. Anyway I need help debugging my javascript
which has been pieced together from several other posts/people in
relation to the topic of reloading two frames from a link in a image
map. Here is the code it doesn't work, Please Help!

You can check out the live page at

http://www.maddash.net/videos/oakwood

<html>
<head>
<title>Oakwood</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script language="javascript">
function update1() {
Top.Video.location="oakwood_wmhs.htm";
Top.Selector.location="selector_oakwood.htm"; }

function update2() {
Top.Video.location="driessche_wmhs.htm";
Top.Selector.location="selector_driessche.htm"; }

function update3() {
Top.Video.location="wilson_wmhs.htm";
Top.Selector.location="selector_wilson.htm"; }

function update4() {
Top.Video.location="bradley_wmhs.htm";
Top.Selector.location="selector_bradley.htm"; }
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<img src="submenu.jpg" width="297" height="480" border="0"
usemap="#Map">
<map name="Map">
<area shape="rect" coords="172,7,285,30"
href="javascript:onClick=update1();" alt="Main Video">
<area shape="rect" coords="27,166,283,248"
href="javascript:onClick=update2();" alt="Annmarie Driessche">
<area shape="rect" coords="28,253,269,334"
href="javascript:onClick=update3();" alt="Sandy Wilson">
<area shape="rect" coords="28,338,266,423"
href="javascript:onClick=update4();" alt="Anne Marie Bradley">
<area shape="rect" coords="248,445,290,472"
href="http://www.maddash.net/videos/troubleshoot.htm" target="_blank"
alt="Help!">
</map>
</body>
</html>

Jul 23 '05 #1
8 1396
Lee
he************@gmail.com said:

I am in no way a scripter/programmer of any kind but I am in charge of
a number of online videos. Anyway I need help debugging my javascript
which has been pieced together from several other posts/people in
relation to the topic of reloading two frames from a link in a image
map. Here is the code it doesn't work, Please Help!

When copying code that you don't understand, you need to copy
very carefully. Don't use "Top" if the original code said "top".
Don't combine: href="javascript:" onClick="update1()"
into: href="javascript:onClick="update1()"

Jul 23 '05 #2
Ivo
<he************@gmail.com> wrote
... the topic of reloading two frames from a link in a image
map. Here is the code it doesn't work, Please Help!

function update1() {
Top.Video.location="oakwood_wmhs.htm";
Top.Selector.location="selector_oakwood.htm"; }


The topmost window should be referenced as "top" with a lowercase "t".
Also, in your HTML frameset, the name of the frame is "Select", not
"Selector" (I'd use a less confusing name btw). In short, changing the
function as follows should do the trick:

function update1() {
top.frames.Video.location="oakwood_wmhs.htm";
top.frames.Select.location="selector_oakwood.htm"; }

hth
--
Ivo

Jul 23 '05 #3
I updated the code to as follows but I am getting the following errors:

update1 is not defined
update2 is not defined
update3 is not defined
update4 is not defined

<html>
<head>
<title>Oakwood</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="javascript">
function update1() {
top.frames.Video.location="oakwood_wmhs.htm";
top.frames.Selector.location="selector_oakwood.htm "; }

function update2() {
top.frames.Video.location="driessche_wmhs.htm";
top.frames.Selector.location="selector_driessche.h tm"; }

function update3() {
top.frames.Video.location="wilson_wmhs.htm";
top.frames.Selector.location="selector_wilson.htm" ; }

function update4() {
top.frames.Video.location="bradley_wmhs.htm";
top.frames.Selector.location="selector_bradley.htm "; }
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<img src="submenu.jpg" width="297" height="480" border="0"
usemap="#Map">
<map name="Map">
<area shape="rect" coords="172,7,285,30" href="javascript:"
onClick="update1()" alt="Main Video">
<area shape="rect" coords="27,166,283,248" href="javascript:"
onClick="update2()" alt="Annmarie Driessche">
<area shape="rect" coords="28,253,269,334" href="javascript:"
onClick="update3()" alt="Sandy Wilson">
<area shape="rect" coords="28,338,266,423" href="javascript:"
onClick="update4()" alt="Anne Marie Bradley">
<area shape="rect" coords="248,445,290,472"
href="http://www.maddash.net/videos/troubleshoot.htm" target="_blank"
alt="Help!">
</map>
</body>
</html>

Jul 23 '05 #4
he************@gmail.com wrote:
I updated the code to as follows but I am getting the following errors:
update1 is not defined
update2 is not defined
update3 is not defined
update4 is not defined

<html>
<head>
<title>Oakwood</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="javascript">
function update1() {
top.frames.Video.location="oakwood_wmhs.htm";
top.frames.Selector.location="selector_oakwood.htm "; }

function update2() {
top.frames.Video.location="driessche_wmhs.htm";
top.frames.Selector.location="selector_driessche.h tm"; }

function update3() {
top.frames.Video.location="wilson_wmhs.htm";
top.frames.Selector.location="selector_wilson.htm" ; }

function update4() {
top.frames.Video.location="bradley_wmhs.htm";
top.frames.Selector.location="selector_bradley.htm "; }
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<img src="submenu.jpg" width="297" height="480" border="0"
usemap="#Map">
<map name="Map">
<area shape="rect" coords="172,7,285,30" href="javascript:"
onClick="update1()" alt="Main Video">
<area shape="rect" coords="27,166,283,248" href="javascript:"
onClick="update2()" alt="Annmarie Driessche">
<area shape="rect" coords="28,253,269,334" href="javascript:"
onClick="update3()" alt="Sandy Wilson">
<area shape="rect" coords="28,338,266,423" href="javascript:"
onClick="update4()" alt="Anne Marie Bradley">
<area shape="rect" coords="248,445,290,472"
href="http://www.maddash.net/videos/troubleshoot.htm" target="_blank"
alt="Help!">
</map>
</body>
</html>


Replace the double 'slanted' quotes here:

<script language="javascript">

....with HTML-standard 'curly' doubles. Helps get those functions
declared.

Also: add ------> return false;
as the final line in each 'update' function, and call them like so:

<area shape="rect" coords="172,7,285,30" href="some_url"
target="_blank"
onclick="return update1()" alt="Main Video">

'some_url' should download a meaningful page of some sort for those
with JS disabled.

Jul 23 '05 #5
RobB wrote:
he************@gmail.com wrote:

<--snip-->
<script language="javascript">


<--snip-->
Replace the double 'slanted' quotes here:

<script language="javascript">

....with HTML-standard 'curly' doubles. Helps get those functions
declared.


No, stop using the language attribute and use the type attribute instead:

<script type="text/javascript">
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #6
Ivo
"RobB" wrote
he************@gmail.com wrote


Hi, I took all and more tips together in th following code. You 'll note
that there is only one function update(), which takes the link as parameter.
All links are hardcoded in the HTML for the js-less, and converted to the
appropriate url's in the javascript. This is possible thanks to your already
consistent naming scheme.

<html><head><title>Oakwood</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">

function update(s) { s=s.href;
top.frames.Video.location.href=s;
top.frames.Select.location.href=s.replace( /(\w+)_wmhs/, 'selector_$1' );
return false;
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<img src="submenu.jpg" width="297" height="480" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="172,7,285,30" href="oakwood_wmhs.htm"
onclick="return update(this);" target="Video" alt="Main Video">
<area shape="rect" coords="27,166,283,248" href="driessche_wmhs.htm"
onclick="return update(this);" target="Video" alt="Annmarie Driessche">
<area shape="rect" coords="28,253,269,334" href="wilson_wmhs.htm"
onclick="return update(this);" target="Video" alt="Sandy Wilson">
<area shape="rect" coords="28,338,266,423" href="bradley_wmhs.htm"
onclick="return update(this);" target="Video" alt="Anne Marie Bradley">
<area shape="rect" coords="248,445,290,472"
href="/videos/troubleshoot.htm" target="_blank" alt="Help!">
</map>
</body>
</html>

--
Ivo


Jul 23 '05 #7
DU
he************@gmail.com wrote:
I am in no way a scripter/programmer of any kind but I am in charge of
a number of online videos. Anyway I need help debugging my javascript
which has been pieced together from several other posts/people in
relation to the topic of reloading two frames from a link in a image
map. Here is the code it doesn't work, Please Help!

You can check out the live page at

http://www.maddash.net/videos/oakwood

<html>
<head>
<title>Oakwood</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script language="javascript">
function update1() {
Top.Video.location="oakwood_wmhs.htm";
Top.Selector.location="selector_oakwood.htm"; }

I suggest you use this form (for better cross-browser support) rather:

function update1() {
top.frames["Video"].location.href = "oakwood_wmhs.htm";
top.frames["Selector"].location.href = "selector_oakwood.htm"; }

Note that it's top, not Top.
function update2() {
Top.Video.location="driessche_wmhs.htm";
Top.Selector.location="selector_driessche.htm"; }

function update3() {
Top.Video.location="wilson_wmhs.htm";
Top.Selector.location="selector_wilson.htm"; }

function update4() {
Top.Video.location="bradley_wmhs.htm";
Top.Selector.location="selector_bradley.htm"; }
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" are all
non-standard. If you really want your frame to have no margins, then use
the proper attributes (marginwidth marginheight) on the frame:
http://www.w3.org/TR/html4/present/f...f-marginheight
http://www.w3.org/TR/html4/present/f...ef-marginwidth
and define a css rule for the body node in the framed document.
<img src="submenu.jpg" width="297" height="480" border="0"
usemap="#Map">
<map name="Map">
<area shape="rect" coords="172,7,285,30"
href="javascript:onClick=update1();" alt="Main Video">


Do not use href="javascript:onClick=update1();": this does not make
really any sense.
I suggest you avoid an image map for this and use real HTML buttons.

<button type="button" onclick="update1();">View main video</button>

otherwise, at least, use the onclick event handler and the nohref
attribute accordingly
http://www.w3.org/TR/html4/struct/ob...ml#adef-nohref

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.6 :)
Jul 23 '05 #8
Thanks! Everything is working except that I get a blank JavaScript
Console window when testing in Firefox 1.0.2. There are no errors but
after clearing the caches and restarting I still get a blank window

Jul 23 '05 #9

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

Similar topics

0
by: Katie M | last post by:
Hi, I'm running into a problem where the Microsoft Script Debugger is no longer starting up when it encounters an error or breakpoint. It used to prompt whenever it encountered an error, but is...
28
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as...
6
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module....
1
by: Manfred Braun | last post by:
Hi All, I am writing a tool, which should monitor some exe-processes, which are not very solid. Th main function is to re-start them, if they hung, but this is complicated. I can detect things...
1
by: Richard Gordon | last post by:
I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32 using MS SAPI 5.1 and Hammond's win32 module. The test program is import pyTTS tts = pyTTS.Create() tts.Speak('Hello...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.