|
-
Jul 8th, 2003, 06:54 PM
#1
Thread Starter
transcendental analytic
two quick questions
1. Is there any limit to how many div tags you can nest, if not would it affect performance to make a list by nesting div tags?
2. Is there a performance issue using innerhtml to update an entire page as long as its stored in javascript? Any other way of just updating a small portion of a div tag?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 8th, 2003, 07:03 PM
#2
Thread Starter
transcendental analytic
another question, is it possible to make a link open a page when javascript is not activated, while doing something else when it is?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 8th, 2003, 09:18 PM
#3
Well, there is the <noscript> tag to use when a browser doesn't support scripting. I don't know if that helps or not.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jul 9th, 2003, 12:00 AM
#4
Re: two quick questions
Originally posted by kedaman
1. Is there any limit to how many div tags you can nest, if not would it affect performance to make a list by nesting div tags?
2. Is there a performance issue using innerhtml to update an entire page as long as its stored in javascript? Any other way of just updating a small portion of a div tag?
1. No, it doesn't affect performance too much, and there's no limit. What would be your reason for using <div> instead of <ul> or <ol> for a list?
2. That isn't really reccommended. It gets too cumbersome... what exactly are you trying to update in your div tag?
another question, is it possible to make a link open a page when javascript is not activated, while doing something else when it is?
You can't actually make a page open up if javascript isn't activated. What you can do, though, is put a sniffer on a page before this page, so that if javascript is activated, it goes to your desired page, otherwise, you display some other page instead.
Or use the <noscript> tag, in which you can put HTML tags.
-
Jul 9th, 2003, 01:54 AM
#5
Second question: yes, it is possible:
Code:
<a href="url" target="_blank" onclick="return doYourStuff()">...</a>
doYourStuff must return false.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 9th, 2003, 07:30 AM
#6
Thread Starter
transcendental analytic
Thanks for all the answers
mendhak, if i have a lot of text, in a div tag, wouldn't it be better performancewise if i just updated a nested div tag with less text?
thanks CB for the elegant solution
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 9th, 2003, 01:15 PM
#7
Well, yeah, you could do that.
By the way, can you show how you are doing the update of that DIV tag?
Although I don't know the full details of your page, an alternative to what you're trying is to have two DIVs, (div1 and div2), with div2 hidden. When desired, you simply hide div1 and show div2.
IF that's similar to what you're trying, then what I just suggested is better, performance-wise.
Otherwise, you ought to go ahead with your "update" idea, which you really should show me... by update, are you referring to rewriting with javascript's document.write() ?
-
Jul 9th, 2003, 02:09 PM
#8
Thread Starter
transcendental analytic
well, you could check out the page in my sig, the one that used to be about squirrel.
I'm having javascript files loaded dynamically to update the page instead of having everything loaded from start.
Btw how do i jump to a certain div tag, in the script?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 10th, 2003, 01:49 AM
#9
What do you mean, jump to?
To get the div tag for manipulation, give it an id property and use document.getElementById(string)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 10th, 2003, 04:03 AM
#10
Your page seems fine, but what if the amount of text you have to display is a lot? Try playing with that and see what happens.
Btw how do i jump to a certain div tag, in the script?
Not sure what you mean, could it be
<a name="placename">Title flaskdjflaskjf</a>
Then to jump to it, a link as such: <a href="#placename">Click here</a>
-
Jul 10th, 2003, 09:37 AM
#11
Thread Starter
transcendental analytic
yeah I want it to jump to the div tag, but not directly by clicking the link but when decided so trough javascript, the link calling the javascript function. My page doesn't have stuff enough for it to jump yet but once i have more than for it to fit into browser you would want to jump there.
Code:
if(document.getElementById(url)!=null){
//JUMP to it here
return false;
}
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 10th, 2003, 12:11 PM
#12
On modern browsers this works:
Code:
location.href += "#" + thediv.id;
// or thediv.getAttribute("id");
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 10th, 2003, 01:41 PM
#13
Originally posted by CornedBee
On modern browsers this works:
Code:
location.href += "#" + thediv.id;
// or thediv.getAttribute("id");
Yes, as opposed to browsers from the 1600s.
-
Jul 11th, 2003, 02:09 AM
#14
Hey, I'm not sure if even IE5.5 works with # and element ids.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 12th, 2003, 06:46 AM
#15
Thread Starter
transcendental analytic
Thanks again, I had to do a little modification though, or it would add up the #'s:
location.href = "#" + url;
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|