PDA

View Full Version : [DHTML] Ajax includes with document.write and innerHTML



molendijk
06-29-2008, 07:45 PM
1) CODE TITLE: Ajax includes with document.write and innerHTML

2) AUTHOR NAME/NOTES: Molendijk

3) DESCRIPTION: See title. I wrote this for myself, but it may also be of use to some of you.

4) URL TO CODE: http://molendijk.110mb.com/include_via_ajax/includer.html

Master_script_maker
06-29-2008, 09:26 PM
very nice script, but a couple of minor things:
1. shouldn't document.includeWrite be document.prototype.includeWrite, and document.includeInner be document.prototype.includeInner

2. for the includeInner function, wouldn't it be more functional if it returned the value?

molendijk
06-29-2008, 09:48 PM
1. shouldn't document.includeWrite be document.prototype.includeWrite, and document.includeInner be document.prototype.includeInner
Sorry, I don't get what you mean. What would 'prototype' add regarding the practical use (outcome) of the function?



2. for the includeInner function, wouldn't it be more functional if it returned the value?
What do you mean by 'value'?

Anyhow, thanks for the reaction.
-----
Arie.

Master_script_maker
06-29-2008, 09:57 PM
Sorry, I don't get what you mean. What would 'prototype' add regarding the practical use (outcome) of the function?


What do you mean by 'value'?

Anyhow, thanks for the reaction.
-----
Arie.
it wouldn't add use, but would make it more proper (http://www.javascriptkit.com/javatutors/proto.shtml, http://www.javascriptkit.com/javatutors/proto2.shtml, http://www.javascriptkit.com/javatutors/proto3.shtml).

i mean returning reqInner.responseText

molendijk
06-29-2008, 10:14 PM
it wouldn't add use, but would make it more proper (http://www.javascriptkit.com/javatutors/proto.shtml, http://www.javascriptkit.com/javatutors/proto2.shtml, http://www.javascriptkit.com/javatutors/proto3.shtml).
I see, thanks.



i mean returning reqInner.responseText
The reqInner.responseText is in the function. For instance, I have
function fetch_with_inner1(){document.includeInner('fetch_with_inner1.html'); document.getElementById('fetch_with_inner1').innerHTML = reqInner.responseText}
---
Arie.