aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes problem in paging using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem in paging using javascript" Watch "problem in paging using javascript" New topic
Author

problem in paging using javascript

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 939
Here is my code:




Code is working properly, but can anyone tell me is there any other way to do this, here the function is being called so many of times.
how can i do this, without calling the hide function again and again???
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18165
    
    8

If you had a "hideall" function then your code could look like this:
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 939
Paul Clapham wrote:If you had a "hideall" function then your code could look like this:


Thanks paul, but how to make this "hideall" function where as "hide" function is not same always, it somewhere depends on the "show" function, can you tell me exactly...?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

No, it hides all, and therefore is the same each time.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 939
Bear Bibeault wrote:No, it hides all, and therefore is the same each time.


But in my query/problem i don't want to hide same div's each time, if you noticed in the code the showPage function parameter/argument is changing everytime, i m calling that function, nd along that function i want to hide all other respective div's, for that i m calling hide() again nd again, because div id's are not same always/in every calling...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

And if you notice in Paul's example, the correct div is shown after hiding all... Think!
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 939
Bear Bibeault wrote:And if you notice in Paul's example, the correct div is shown after hiding all... Think!



i write function like this:

function hideall()
{
for(int i=1;i<11;i++)
document.divs[i].visibility = "hidden";
}

but it's not working..
sorry if i m nt getting, i m new to js, can you tell me what should i write in hideall()..???
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 939
Punit Jain wrote:
Bear Bibeault wrote:And if you notice in Paul's example, the correct div is shown after hiding all... Think!



okay i done it, code is like this:




and it's working now..
Any modifications will be appreciable....
Thank you all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in paging using javascript
 
Similar Threads
Please help me regarding the forms selection
Retrieve data from other server using JavaScript
Java cookies ?
Pop up calendar Problem
Google use Javascript or ajax on first page?