/    Sign up×
Community /Pin to ProfileBookmark

annoying script error!!?

I’m in the early stages of designing a website and am having some trouble with a script for a dropdown menu that I’ve found on the net (on this site probably).

I’m using the dropdown menu in a contents-frame and I’ve set it so that it should open links in the right (main) frame.

It actually worked initially, but now it says a script error occured every time I try to access a link. This is my first website so I would think that any experienced person would be able to point out the problem for me.

ps. could someone explain to me how to make the “criteria dropdown box script” work in frames? (you know, the one which deals with cars and year built in the example)

whew! hope somebody takes the time to read this!
here’s the html of the contents page:

<html>

<head>

<script>
<!–
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget==”_self”) {window.location=loc;}
else {if (lowtarget==”_
top”) {top.location=loc;}
else {if (lowtarget==”_blank”) {window.open(loc);}
else {if (lowtarget==”_
parent”) {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf(“*”);
target=””;
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target=”_self”;};
if (ref != “”) {land(loc,target);}
}
//–>
</script>

<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<meta name=”GENERATOR” content=”Microsoft FrontPage 4.0″>
<meta name=”ProgId” content=”FrontPage.Editor.Document”>
<title>New Page 3</title>
<base target=”main”>
</head>

<body bgcolor=”#000099″ text=”#FFFFFF” background=”images/background4.gif”>
<form>
&nbsp;
</form>
<p>&nbsp;
<select name=”choice” size=”1″ onChange=”jump(this.form)”>
<option value=””>Brands</option>
<option value=”file:///C:/Work/urside/real/alpina.htm*main”>Alpina</option>
<option value=”file:///C:/Work/urside/real/angelus.htm*
main”>Angelus</option>
<option value=”file:///C:/Work/urside/real/breitling.htm*main”>Breitling</option>
<option value=”file:///C:/Work/urside/real/bulova.htm*
main”>Bulova</option>
<option value=”file:///C:/Work/urside/real/Buren.htm*main”>Büren</option>
<option value=”file:///C:/Work/urside/real/bwc.htm*
main”>BWC</option>
<option value=”file:///C:/Work/urside/real/cartier.htm*main”>Cartier</option>
<option value=”file:///C:/Work/urside/real/certina.htm*
main”>Certina</option>
<option value=”file:///C:/Work/urside/real/suisse.htm*main”>Chronograph Suisse</option>
<option value=”file:///C:/Work/urside/real/citizen.htm*
main”>Citizen</option>
<option value=”file:///C:/Work/urside/real/cortebert.htm*main”>Cortébert</option>
<option value=”file:///C:/Work/urside/real/cyma.htm*
main”>Cyma</option>
<option value=”file:///C:/Work/urside/real/doxa.htm*main”>Doxa</option>
<option value=”file:///C:/Work/urside/real/dunhill.htm*
main”>Dunhill</option>
<option value=”file:///C:/Work/urside/real/elgin.htm*main”>Elgin</option>
<option value=”file:///C:/Work/urside/real/enicar.htm*
main”>Enicar</option>
<option value=”file:///C:/Work/urside/real/eterna.htm*main”>Eterna</option>
<option value=”file:///C:/Work/urside/real/favreleuba.htm*
main”>Farve-Leuba</option>
<option value=”file:///C:/Work/urside/real/fortis.htm*main”>Fortis</option>
<option value=”file:///C:/Work/urside/real/girard.htm*
main”>Girard-Perregaux</option>
<option value=”file:///C:/Work/urside/real/glashutte.htm*main”>Glashütte</option>
<option value=”file:///C:/Work/urside/real/glycine.htm*
main”>Glycine</option>
<option value=”file:///C:/Work/urside/real/gruen.htm*main”>Gruen</option>
<option value=”file:///C:/Work/urside/real/hamilton.htm*
main”>Hamilton</option>
<option value=”file:///C:/Work/urside/real/iwc.htm*main”>IWC</option>
<option value=”file:///C:/Work/urside/real/lecoultre.htm*
main”>Jaeger Le Coultre</option>
<option value=”file:///C:/Work/urside/real/lemania.htm*main”>Lémania</option>
<option value=”file:///C:/Work/urside/real/longines.htm*
main”>Longines</option>
<option value=”file:///C:/Work/urside/real/minerva.htm*main”>Minerva</option>
<option value=”file:///C:/Work/urside/real/movado.htm*
main”>Movado</option>
<option value=”file:///C:/Work/urside/real/omega.htm*main”>Omega</option>
<option value=”file:///C:/Work/urside/real/pierce.htm*
main”>Pierce</option>
<option value=”file:///C:/Work/urside/real/rado.htm*main”>Rado</option>
<option value=”file:///C:/Work/urside/real/record.htm*
main”>Record</option>
<option value=”file:///C:/Work/urside/real/rolex.htm*main”>Rolex</option>
<option value=”file:///C:/Work/urside/real/tagheuer.htm*
main”>Tag-Heuer</option>
<option value=”file:///C:/Work/urside/real/tavannes.htm*main”>Tavannes</option>
<option value=”file:///C:/Work/urside/real/tissot.htm*
main”>Tissot</option>
<option value=”file:///C:/Work/urside/real/titus.htm*main”>Titus</option>
<option value=”file:///C:/Work/urside/real/universal.htm*
main”>Universal</option>
<option value=”file:///C:/Work/urside/real/wittnauer.htm*main”>Wittnauer</option>
<option value=”file:///C:/Work/urside/real/zenith.htm*
main”>Zenith</option>
<option value=”file:///C:/Work/urside/real/zodiac.htm*main”>Zodiac</option>
<option value=””>- – – – – – – – – -</option>
</select>
</p>
</body>

</html>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisFeb 03.2003 — It would have been nice if you had included the actual error.

Also, your frameset structure would have been enlightening.

I suspect that your trouble lies in this line:
else {parent.frames[target].location=loc;}; [/quote]It might work better if you change it to:

[font=monospace]else {window.top.frames[target].location=loc;};[/font]

If that is not helpful, at least include the error (text and line number) in your next post.
Copy linkTweet thisAlerts:
@Bobby_PeruauthorFeb 03.2003 — I just realized that it might have something to do with me cut-and-pasting scripts directly into frontpage.

I just tried to import a script and it gave me a similar error message, but when I tried to paste it into notepad, and from there into frontpage it worked.... hmmm... am I missing something?

thanks for your help, btw! The error is as follows:

Line: 20

Char: 1

Error: objekt er obligatorisk ("an object is mandatory" I guess)

Code: 0

the frameset html hasn't been tampered with at all:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>New Page 1</title>

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

</head>

<frameset rows="*" framespacing="0" border="0" frameborder="0">

<frameset cols="584,*
">

<frame name="contents" target="main" src="leftmenu.htm" scrolling="no" noresize marginwidth="0" marginheight="0">

<frame name="main" src="bigwindow.htm" target="_self" scrolling="auto" noresize>

</frameset>

<noframes>

<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>

</noframes>

</frameset>

</html>
Copy linkTweet thisAlerts:
@Bobby_PeruauthorFeb 03.2003 — I just solved it myself...

something to do with moving about the menu outside of a boxed space... probably beginner's mistake

Thanks for your help Gil
×

Success!

Help @Bobby_Peru spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...