Forum Moderators: open
Kaled.
If javascript will not do this, is there a way I could put a server side include into an array and have javascript insert the server sides into my page? The reason I don't stick the server side directly into the page is because I want to rotate it. Please let me know, thank you very much!
Another way would be to use a hidden <iframe> and write an onload event handler to copy the contents into a <div>. It would work something like this, but I haven't tested the code below.
<iframe name="fudge" onload="copyTo(this,'divId')" height="0" src="default.html">
function loadHtml(url){
// fudge.location.replace(url);
// fudge.location.href = url;
fudge.src = url;
}
function copyTo(iframe,divId){
var div = document.getElementById(divId);
if (div) div.innerHTML = iframe.document.body.innerHTML;
}
When testing, set the iframe height to something like 100
Kaled.
You could use ajax technology, however, this requires scripts to be run on the client (javascript) and the server (typically perl I think).
Again, without more detail as to what you want to do and why, no one can give you reliable advice. So far, you haven't even said whether you are using static html or php (or something else).
Kaled.
Php can call these type files, was wondering if javascript could do the same.
I notice on a couple of exact same rotators I have, replacing it to rotate iframes instead of images, that the iframes rotate at a couple seconds minimum, for a tiny html file or tiny .txt file. Compared to rotating the images which can go very, very, fast in milliseconds even. That is why I wanted to find out other options other than Iframes to see if I could rotate some items faster. Please let me know, thanks.
Sounds like you might be saying iframes might be slower when they are loading whole files because they have to go to the server and browser where images are only in our ftp account? Don't know if I read you right on that or not. No one has told me whether javascript can call .html or .txt files, (actual files not text), guess that means they can't.
BTW ..and politeness when asking questions which were not expressed as detailed as you may have thought will get you much more ( free ) help ..or you might try fora where you can be cavalier with the respondants ..but they usually require that you pay to see the answers ..or to get the knowledge that you dont have ..kaled was trying to help ..and needed clarification to do so