Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

I'm a retard

Name: Anonymous 2011-06-25 21:54

Preface: I'm fuck awful at scripting

Making a little self-interest site to pass the time and I'm stuck when trying to create a script that will allow 2 individual buttons labeled "Previous" and "Next Page" from doing their respective jobs, which I would assume is obvious.

Could anyone inform me, or direct me to where I may learn to implement such a feature? Also, keep in mind my preface and cut me some slack if you try to explain the function yourself.

Appreciated

Name: Anonymous 2011-06-25 22:00

Scripting? Function?

It's called an anchor element, son.

Name: Anonymous 2011-06-25 22:03

Good stuff, now I know it's proper name

Lack of code is disappointing, however

Name: Anonymous 2011-06-25 22:03

an anchor element

as in <a>

as in a LINK

Why would you want to use javascript just to move between pages?

Name: Anonymous 2011-06-25 22:05

ONE WORD: JAVASCRIPT

Name: Anonymous 2011-06-25 22:42

What's wrong with this code

<script type="text/javascript">
var pNum=0;
var maxPage=100;
function next()
{
pNum++;
if (pNum > maxPage) pNum=0;
document.getElementById("frame").src="page"+pNum+".htm";
{
</script>

Whenever I go past the max number of pages it goes to a 404 instead of cycling back to the start page.

What do?

Name: Anonymous 2011-06-25 23:04

anyone?

Name: Anonymous 2011-06-25 23:57

Do you have 100 pages or 101 pages?

Name: Anonymous 2011-06-26 1:35

you need to have a 0.htm and a 100.htm

Name: Anonymous 2011-06-26 4:19

put the pages in an array,
on click next, pages++ then return location.href(page)

Name: Anonymous 2011-06-26 4:53

>>6
Does page0.htm exist?

Name: Anonymous 2011-06-26 7:07

>>6

You're missing some braces for the if statement

Name: Anonymous 2011-06-26 7:10

He's not here, and can't be helped anyway. Don't bother.

Name: Anonymous 2011-06-26 10:57

ok
can't be helped
Is that some /jp/ meme ?

Name: Anonymous 2011-06-26 11:08

Is that some /jp/ meme ?
Maybe I'm not very familiar with anything Japan.

Name: Anonymous 2011-06-26 11:49


Don't change these.
Name: Email:
Entire Thread Thread List