View Full Version : how to make a html page that doesn't blink every time i load another page
gonzolo
December 26th, 2005, 02:11 PM
is there any way to preload html pages or make multiple sites in one document? this is what i wan't to make not blink every time i shift page http://www.gonzolo.dk/camilla
Templarian
December 26th, 2005, 02:22 PM
javascript
gonzolo
December 26th, 2005, 02:24 PM
danx but plz explain
esnetni
December 26th, 2005, 03:03 PM
wrong section http://www.kirupa.com/forum/forumdisplay.php?f=19
Jeff Wheeler
December 26th, 2005, 03:11 PM
Because I'm sure you aren't interesting in learning about javascript, do something like this in your links (why are you using Flash!?); also make sure to name the td with the content id myCell:
new ajax('file.html', update: $('myCell'));
Make sure to include this in your file:
http://www.mad4milk.net/examples/mooajax/moo.ajax.js
About it here:
http://www.mad4milk.net/entry/moo.ajax
gonzolo
December 26th, 2005, 03:15 PM
first of all it's standart dreamweaver btns also danx
Templarian
December 26th, 2005, 03:16 PM
i you did want to use JS. u could just hide what you didnt want to show although this is just a basic examle there would be mroe code needed.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="Javascript 1.2"
type="text/javascript">
function show(id)
{
el = document.getElementById(id);
if (el.style.display == 'none')
{
el.style.display = '';
el = document.getElementById('more' + id);
el.innerHTML = 'less...';
} else {
el.style.display = 'none';
el = document.getElementById('more' + id);
el.innerHTML = 'more...';
}
}
</script>
</head>
<body>
Basically hit the link>>
<a id="moreinfo"
onclick="javascript:show('info');return false;"
href="info.html" target="_new">more...</a>
<div id="info" style="display: none">
Hey loock this text appeared.
</div>
</body>
</html>
Jeff Wheeler
December 26th, 2005, 03:21 PM
That works too, but then you have to wait for load in the beginning, and merge several files into one, rather than preserving several files.
It really doesn't matter at all. I suppose your way is better for accessibility, but if you're concerned about that, I would add the hiding in a setup method in js.
gonzolo
December 26th, 2005, 03:23 PM
is there no build in function's in dreamweaver or golive that could do this?
Jeff Wheeler
December 26th, 2005, 03:24 PM
Whatever they do will be messy. Just hand-code it ;)
gonzolo
December 27th, 2005, 06:01 AM
is there no way to use php to make multiple pages in one like for example this forum?
Jeff Wheeler
December 27th, 2005, 10:29 AM
What? What part of this forum (it's using ajax galore!)
gonzolo
December 27th, 2005, 11:02 AM
http://www.kirupa.com/forum/showthread.php?p=1738829#post1738829 also what is ajax galore? and moo.ajax.js?__________/\_________
____________________________yes that says php_________________________
Jeff Wheeler
December 27th, 2005, 11:10 AM
ajax galore just means it uses a lot of Ajax… it's not a special term or anything
moo.ajax.js is what allows you to so easily make an ajax request like the one I showed you. Otherwise it takes much more code.
I still don't understand what part of this page you're referring to?
gonzolo
December 27th, 2005, 11:11 AM
the red one!!!;) also what is ajax???
gonzolo
December 27th, 2005, 11:14 AM
i made my point quite clear don't u think???
Jeff Wheeler
December 27th, 2005, 11:17 AM
I know you're talking about this page being php, but there's nothing special going on here. It's just taking the thread number given in the url (?t=blah) and requesting from a database the related posts.
Ajax is Asynchronous Javascript and XML.
That means that javascript will create an instance of the XMLHTTPRequest object, which is then used to make a GET or POST request to a page on the server, which should return xml which is then parsed, but in your case, that's rather unnecessary.
In your case, you're simply using the XMLHTTPRequest object in javascript to make a call to a certain page, depending on which link was clicked, and then placing the entire response inside a table cell.
gonzolo
December 27th, 2005, 11:19 AM
danx a lot for the quick reply:D
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.