By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

Why can't I get a large jump list to work?

P: n/a
Is there a limit to how many items can be in a jump list?

My script worked fine with 126 items, but at 152 items it just doesn't
work. When I select a page from the drop down menu it will only bring
me to one particular Web page among the 152, a page I haven't
selected. It's the same page all the time.

The alternative reason why it doesn't work is that I've munged up some
part of the javascript. I've had to adjust all 152 items by hand, so I
may well have screwed something up. Does anyone know of a piece of
software or some technique that will allow me to just highlight a list
of file names and turn them into a jump list? The way I'm doing it is
tedious.

Here's a truncated version of my javascript, the file names have been
changed to protect the guilty.

<!--Here's where the javascript begins.-->
<script language='JavaScript'>
<!--
function jump()
{
jval=document.joform.jsel.selectedIndex;
if (jval==0)
{
loc='foobar_12-22-03.html';
}
if (jval==1)
{
loc='foobar_12-08-03.html';
}
if (jval==2)
{
loc='foobar_11-24-03.html';
}
if (jval==3)
{
loc='foobar_11-10-03.html';
}
if (jval==4)
{
loc='foobar_10-27-03.html';
}
.....
if (jval==150)
{
loc='foobar_02-23-98.html';
}
if (jval==151)
{
loc='foobar_02-09-98.html';
}
window.open(loc,'_top')
}
// End JavaScript -->

</script>

And of course there's a form.

<form name="joform" size=1>
<select name="jsel">
<option selected>Web page for December 21/22, 2003
<option>Web page for December 7/8, 2003
<option>Web page for November 23/24, 2003
<option>Web page for November 9/10, 2003
<option>Web page for October 26/27, 2003
.....
<option>Web page for February 22/23, 1998
<option>Web page for February 8/9, 1998
</select>
<a href="javascript:jump()"><img src="graphic.jpg" width="44"
height="28" align="Absmiddle" border="0" alt="click here to see the
page"></a>
</form>

Any hints would be appreciated. I may just be too tired by this time
to be able to see the obvious.
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In article <1o********************************@4ax.com>,
no****@nospam.invalid enlightened us with...

The alternative reason why it doesn't work is that I've munged up some
part of the javascript. I've had to adjust all 152 items by hand, so I
may well have screwed something up. Does anyone know of a piece of
software or some technique that will allow me to just highlight a list
of file names and turn them into a jump list? The way I'm doing it is
tedious.


It sure is. Do you have a server-side language available? All you would
have to do would be to make a server-side generated list with all the
file names in the directory.
PHP, ASP, even Perl...?

I've got a PHP script around here somewhere that lists files in a
directory and writes them out. That's easy to make into a jump menu.

--
--
~kaeli~
Once you've seen one shopping center, you've seen a mall.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

P: n/a
In article <1o********************************@4ax.com>,
no****@nospam.invalid enlightened us with...

fix this to be more cross-browser...
<!--Here's where the javascript begins.-->
<script language='JavaScript'> <script language="javascript" type="text/javascript"> <!--
function jump()
{
jval=document.joform.jsel.selectedIndex;
jVal=document.forms["joform"].elements["jsel"].selectedIndex;

And of course there's a form.

<form name="joform" size=1>
<select name="jsel">
<option selected>Web page for December 21/22, 2003
</option> is required for any non-IE browser. Might be munging up IE,
too.
<a href="javascript:jump()"><img src="graphic.jpg" width="44"
height="28" align="Absmiddle" border="0" alt="click here to see the
page"></a>


How about something a little better for non-JS folks like people with
disabilities?
<a href="graphic.jpg" onClick="jump();return false;"><img
src="graphic.jpg" width="44" height="28" align="Absmiddle" border="0"
alt="click here to see the page"></a>
--
--
~kaeli~
Murphy's Law #2030: If at first you don't succeed, destroy
all evidence that you tried.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3

P: n/a
kaeli <ti******@NOSPAM.comcast.net> writes:
</option> is required for any non-IE browser. Might be munging up IE,
too.


While I highly recommend including it, it is not required by HTML 4.
The HTML 4.01 specification says about the option element:
Start tag: required, End tag: optional

It is, ofcourse, required by XHTML, but that's a different beast to
begin with.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

P: n/a
JRS: In article <1o********************************@4ax.com>, seen in
news:comp.lang.javascript, Sleepless on the Web <no****@nospam.invalid>
posted at Mon, 9 Feb 2004 11:50:13 :-
function jump()
{
jval=document.joform.jsel.selectedIndex;
if (jval==0)
{
loc='foobar_12-22-03.html';
}
if (jval==1)
{
loc='foobar_12-08-03.html';
}
if (jval==2)
{
loc='foobar_11-24-03.html';
}
if (jval==3)
{
loc='foobar_11-10-03.html';
}
if (jval==4)
{
loc='foobar_10-27-03.html';
}
....
if (jval==150)
{
loc='foobar_02-23-98.html';
}
if (jval==151)
{
loc='foobar_02-09-98.html';
}
window.open(loc,'_top')
}


Or something like

function jump() {
var jval=document.joform.jsel.selectedIndex;
var ASDF = [
'12-22-03',
'12-08-03',
...
'02-09-98']
loc = "foobar_" + ASDF[jval] + ".html"
window.open(loc, '_top')
}
If that lot is for public use, rather than merely in the USA, change
those dates to standard form, 2003-12-22 etc.

However, you may be able to access the value of the selected element and
compute the URL from that -

S = "Web page for December 7/8, 2003"
S = S.replace(/(.*) (\w+) \d\d?\/(\d\d?), (\d{4})/, "$4 $2 $3")
gives 2003 December 8 which can be read by new Date

But you may have an end-of-month problem in labelling.
Those dates appear to be alternate Sunday/Monday; therefore both the
option string and the URL string can be computed from the index.

A drop-down of that length is too long for comfort anyway; have a drop-
down for years, then maybe one for months, then one for events therein.

Read the newsgroup FAQ.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.