Log in

View Full Version : My doubts



a1v1n4
12-04-2006, 06:40 PM
I have no questions on codes. I am doing a research on DHTML and Javascript for my studies.

I would like to know, DHTML, which commonly includes Javascripts, HTML, Style Sheets can be implemented. If Javascripts and Style Sheets can be external, will the HTML takes more time to load than to use them internally?

Twey
12-04-2006, 07:22 PM
The file will take a slightly larger amount of time the first time it is loaded (since an extra request must be sent to the server), but this is negligible, and any subsequent pages that use that file will be significantly faster, since the data needn't be downloaded afresh.

Also, DHTML is an inaccurate buzz-word. Please avoid it if possible :)

mburt
12-04-2006, 09:52 PM
Also, DHTML is an inaccurate buzz-word. Please avoid it if possible

So what would be the correct term for "DHTML"?

boxxertrumps
12-04-2006, 09:59 PM
DHTML is just a term coined to represent the combination of JS, HTML, and CSS to create a visually desirable web page.

I Like To Feel Useful...

Twey
12-04-2006, 10:03 PM
Hehe :)
I don't like DHTML because it seems to me to imply that the effects are achieved by means of pure HTML, or some extension of HTML, rather than at least two completely different languages applied to a piece of HTML markup.

mburt
12-04-2006, 10:04 PM
DHTML is just a term coined to represent the combination of JS, HTML, and CSS to create a visually desirable web page.

Yes, I knew that :p
I was wondering if there is an actual term for these languages combined. Thanks anyway though.

Twey
12-04-2006, 10:08 PM
Yes, it's called "web development" :p

a1v1n4
12-11-2006, 07:46 AM
Thank you so much. =)

a1v1n4
01-03-2007, 03:02 PM
I have another question again.

I wanted to add JavaScript(showing the time), but it seems that it does not work on IE7.

Are there alternatives that I can do, instead of using other Internet Browsers? What's the "best" Internet Browser for DHTML?

I assume that most users use Internet Explorer, if that is true, can web developers change their codes to allow IE to display the "right" output?

Thanks.

Twey
01-03-2007, 05:08 PM
I wanted to add JavaScript(showing the time), but it seems that it does not work on IE7. Chances are you've done something wrong, or failed to compensate for a bug. However, I suspect the former: this isn't (or shouldn't be) a complex script.
Are there alternatives that I can do, instead of using other Internet Browsers?Yes, fix your script.
What's the "best" Internet Browser for DHTML?Define "best," and the application of "DHTML" to which you refer.
I assume that most users use Internet ExplorerAlas yes.
can web developers change their codes to allow IE to display the "right" output?Usually, with varying amounts of effort and success.

A simple clock script would be:
<span id="clock">&nbsp;</span>
<script type="text/javascript">
function startClock(el) {
var retval = stopClock(el);
el.clockTimer = window.setInterval(function() { clockTick(el); }, 1000);
return retval;
}

function clockTick(el) {
var d = new Date();
el.firstChild.nodeValue = [d.getHours(), d.getMinutes(), d.getSeconds()].join(":");
}

function stopClock(el) {
if(el.clockTimer !== null) {
window.clearInterval(el.clockTimer);
el.clockTimer = null;
return true;
} else return false;
}

startClock(document.getElementById("clock"));
</script>

mburt
01-03-2007, 05:45 PM
A simple clock script would be

Simple? Ouch, I can't even understand how that works. Well, I do, but it just seems really complex. I would prefer to write out the variables for time...

var date = new Date()
var hours = date.getHours()
var minutes = date.getMinutes()
And then display them simply by assigning innerHTML, or innerText (doesn't work in Firefox) a value.
Just my opinion though :)

Oh, and btw, what does "!==" mean?

Twey
01-03-2007, 06:03 PM
I would prefer to write out the variables for time...There's no point creating variables if you're only going to use them once :)
And then display them simply by assigning innerHTML, or innerText (doesn't work in Firefox) a value.innerHTML is non-standard and ugly. innerText is IE-only.
Oh, and btw, what does "!==" mean?Opposite of ===: non-type-casting comparison. It's slightly more efficient than its more lax companion ==, so should be used where possible.

a1v1n4
01-04-2007, 03:16 PM
Thanks for your answer.
Anyway, the time display works! Thanks a lot.

What I mean by "best" is that,
which Internet browser that supports most of the codes, or is it all the same?

a1v1n4
01-04-2007, 03:18 PM
oh ya.. erm. JavaScripts.. they seems more complicating than CSS to beginners like me.

that's the application of "DHTML" that i'm refering to