/    Sign up×
Community /Pin to ProfileBookmark

Self Increasing Links

Hi, I’m new to javascript so this question might have a really simple solution however I don’t what it is so any type of help is much appreciated. What I’m trying to accomplish is this, I have system set up where I input information into my database it is then displayed on my web page. I want to have it set up so the page only displays 10 titles at a time after 10 I want a link to show up to display the remaining titles in the database. So for example lets say today I input 8 titles, the page should be fine with no links but if tomorrow I have 20 titles I want only the first 10 to show and a link to show up to show the user the remaining titles. So again for example, by the time I get to like 50 titles I want links to be displayed something like this:

1-2-3-4-5

However, I do want the on page link to stand out from the other number links, so if I was to view titles from link 3, link 3 should either be bigger or a different color or something so users can know what page link they are viewing.

I hope I explained this well, can anyone help me? Thanks…

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@AscendancyMar 20.2007 — Do you mean something like this?

[IMG]http://i72.photobucket.com/albums/i178/Keyblademasta69/numbers.gif[/IMG]

^^Taken from Photobucket's links.
Copy linkTweet thisAlerts:
@code300authorMar 20.2007 — yes, thats exactly it... do you know how I could do that for my webpage? Thanks...
Copy linkTweet thisAlerts:
@code300authorMar 24.2007 — Does anyone know how I can figure out how to program the feature stated above? I still haven't figured out a way...
Copy linkTweet thisAlerts:
@konithomimoMar 24.2007 — Hi, I'm new to javascript so this question might have a really simple solution however I don't what it is so any type of help is much appreciated. What I'm trying to accomplish is this, I have system set up where I input information into my database it is then displayed on my web page. I want to have it set up so the page only displays 10 titles at a time after 10 I want a link to show up to display the remaining titles in the database. So for example lets say today I input 8 titles, the page should be fine with no links but if tomorrow I have 20 titles I want only the first 10 to show and a link to show up to show the user the remaining titles. So again for example, by the time I get to like 50 titles I want links to be displayed something like this:

1-2-3-4-5

However, I do want the on page link to stand out from the other number links, so if I was to view titles from link 3, link 3 should either be bigger or a different color or something so users can know what page link they are viewing.

I hope I explained this well, can anyone help me? Thanks...[/QUOTE]


If you are already pulling data from a DB then you are either using AJAX, or a server-side language such as PHP. If you are using a server-side language then it would be better to do it that way. To it with JS you will have to get the data from the DB, to tell you how many titles there are total, and the create the links. Before we can help you though we need to know what information you will be send the JS, that way the code works as intended.
×

Success!

Help @code300 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.21,
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,
)...