| Coding Forum Problems with your code? Let's hear about it. |
10-19-2003, 06:37 PM
|
#1 (permalink)
|
|
v7n Mentor
Join Date: 10-13-03
Location: Ft. Lewis, WA
Posts: 3,264
|
div include?
How would I use div include or whatever on my site so that you can see the background through it? And so it would work exactly like an IFrame? I made a template for a friend and would rather use that than an IFrame once he gets a new host. www.realityisrejection.tk
__________________
My posts were too dang barren, so this got thrown in to take up a little bit of space.
|
|
|
10-19-2003, 07:03 PM
|
#2 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: Statesboro, Georgia
Posts: 3,081
|
What are you wanting to include? A content section? I'm not familiar with "div". 
__________________
"The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."
|
|
|
10-19-2003, 07:19 PM
|
#3 (permalink)
|
|
Inactive
Join Date: 10-13-03
Posts: 275
Latest Blog: None
|
Try this:
[code:1:152f25edc3]
<div style="height: 200px; overflow: auto;>
<!-- #include file = "page.inc" -->
</div>
[/code:1:152f25edc3]
Is this what you wanted to know?
|
|
|
10-19-2003, 08:10 PM
|
#4 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: Statesboro, Georgia
Posts: 3,081
|
Quote:
|
Originally Posted by Distorted
Try this:
[code:1:bfc10aac50]
<div style="height: 200px; overflow: auto;>
<!-- #include file = "page.inc" -->
</div>
[/code:1:bfc10aac50]
Is this what you wanted to know?
|
Is there a tutorial on this somewhere?
__________________
"The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."
|
|
|
10-20-2003, 06:00 AM
|
#5 (permalink)
|
|
Inactive
Join Date: 10-13-03
Posts: 275
Latest Blog: None
|
I don't know. I could look for one when I get home. 
|
|
|
10-20-2003, 06:04 AM
|
#6 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Don't forget it requires SSI on your server.
|
|
|
10-20-2003, 07:15 AM
|
#7 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
Which in turn also needs an .shtml extension instead of .html...
at least it used to - been awhile since I've messed with ssi - since I started with php.
|
|
|
10-20-2003, 09:30 AM
|
#8 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
I'm PHP also, no SSI on my host 
|
|
|
10-20-2003, 12:47 PM
|
#9 (permalink)
|
|
v7n Mentor
Join Date: 10-13-03
Location: Ft. Lewis, WA
Posts: 3,264
|
Well, I just want to use it so that it doesn't have to reload the background every time.
__________________
My posts were too dang barren, so this got thrown in to take up a little bit of space.
|
|
|
10-20-2003, 01:28 PM
|
#10 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
won't work then
includes are inserted on the server, then the whole page is sent to users' machines ech time.
|
|
|
10-20-2003, 05:58 PM
|
#11 (permalink)
|
|
Inactive
Join Date: 10-13-03
Posts: 275
Latest Blog: None
|
You might be able to do that with javascript then.
I'm not sure of the syntax so it would be something like this:
[code:1:ac9a2d511f]
<a href="#" onClick="document.stuff.write='Stuff Goes Here'">Link</a>
[/code:1:ac9a2d511f]
I'm not sure if that would work. It's just an idea. 
|
|
|
10-21-2003, 02:56 AM
|
#12 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
yes but you need the STUFF to either download with the whole page the first time, like my old CV site, or to be fetched over the Internet without the current page being unloaded and reloaded, like my old [lame] CS clan site that only works on IE<edit - it used to!>. [those sites of mine were just experiments and have pleanty of bugs still.]
Obviously loading all the site content in the first page is stupid because users will have to wait ages and the first impression of you site will be 'very slow' and they leave.
Loading each bit of content as needed is the best approach.
<iframes> are the obvious but far from perfect solution.
Invisible iframe is another technique using a 0x0 pixels <iframe> to load any URL, and JavaScript to extract the data from it and paste it into the real page.
*edit - but the invis iframe things is obviously a hack-workaraound and I don't what to use it!
|
|
|
10-21-2003, 08:06 AM
|
#13 (permalink)
|
|
Inactive
Join Date: 10-13-03
Posts: 275
Latest Blog: None
|
Would external javascript files work?
For example, you could have a really long document.write(blah); with the content in a js file and call on it with the onClick event. So, then it would only load the js files when you click on the appropriate link.
Or, not? 
|
|
|
10-21-2003, 09:41 AM
|
#14 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Yes I think it would.
I think the code in the JS file would have to be smething like this:[code:1:51e3259fa0] var stuff = "<element attribute="value">" \
+ "blah etc etc" \
+ "..." \
+ "..." \
+ "</element>";[/code:1:51e3259fa0]
And then do the .innerHTML = stuff when it's completely loaded.
I'm not sure on the code above, but I do know it's annoying trying to get HTML into JS strings. (all on one line or over more lines, escaping all the " marks...).
You could prbably make a PHP script to convert the HTML code in a file to a JS string declaration. But what happenes to .js files with <?PHP ?> in them? Can <script> sources be .php extention?
|
|
|
10-21-2003, 10:00 AM
|
#15 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
I would prefer if some kind of HTTP Request could be used in a JavaScript to load data, but without making the browser navigate to open the file.
I think it can be done, but I don't quite know how.
|
|
|
10-21-2003, 02:35 PM
|
#16 (permalink)
|
|
v7n Mentor
Join Date: 10-13-03
Location: Ft. Lewis, WA
Posts: 3,264
|
Wow, I have no clue what you guys were just talking about.
Ah, oh well, I guess I'll just have to use IFrames.
__________________
My posts were too dang barren, so this got thrown in to take up a little bit of space.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:51 AM.
© Copyright 2008 V7 Inc
|