PDA

View Full Version : Including (snippets of) external HTML via javascript (same domain)



molendijk
04-15-2008, 11:12 PM
1) CODE TITLE: Including (snippets of) external HTML via javascript (same domain)

2) AUTHOR NAME/NOTES: Arie Molendijk

3) DESCRIPTION: Refinement / simplification of earlier posts dealing with client-side includes.
If you cannot / don't want to use server-side includes (PHP etc.) or Ajax for extracting external HTML, this might be an option. The script offers an easy way of including external content (no iframe!).
(In IE, the link to 'script' seems empty; see the source of the (seemingly empty) window to view the script).

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

Nile
04-15-2008, 11:20 PM
Its ok. It can be a little better though, I don't know what would make it better.

molendijk
04-15-2008, 11:24 PM
Its ok. It can be a little better though, I don't know what would make it better.
Nile, any suggestion on how to make it better is wellcome.
----
Arie.

Nile
04-15-2008, 11:27 PM
Well, first of all, it overlaps the border and goes out. So you can try fixing that, and also a little slide effect, like 1 pixel at a time.
Hope this Helps,
Nile

molendijk
04-15-2008, 11:39 PM
Well, first of all, it overlaps the border and goes out. So you can try fixing that, and also a little slide effect, like 1 pixel at a time.
Hope this Helps,
Nile
That's because I just wanted to have a demo-area. It can be easily fixed by giving a certain width to the 'receiver-id' (the main-page-id that receives the external content) or to the demo-area. In normal use, this won't yield a problem.
As for the slide-effect, that's a step further. For the moment, I just wanted to show that you can easily extract external content with the help of javascript. The rest is embellishment.
Thanks for the comment anyway.
----
Arie.

Nile
04-15-2008, 11:42 PM
Yeah, well I think you should just try to do it right now. I think that you have the advanced skills. I think you should give it a shot. But it doesn't really matter, although if you do try, show me, if your having any problems whatsoever, post it. :D

molendijk
04-16-2008, 09:48 AM
(16th april):
corrected an error in the script.
---
Arie M.