Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 01-10-2005, 07:54 PM JavaScript includes
Experienced Talker

Posts: 45
Trades: 0
Is there a way to have Javascript load a text component from another web site into it existing page? Much like an #include or an iframe, but using JavaScript only. I can't use #include, iframes, or any other type of includes for a variety of reasons, so I'm trying to determine if it can be done soley with javascript.

Basically, I have web site abc.com that has a text component that I want to be able to load into a page of efg.com. Make sense?


Thanks
Jacob
planeboy7e7 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-10-2005, 08:18 PM
Experienced Talker

Posts: 45
Trades: 0
Okay, I think I may have found a way, but I'm getting stuck somewhere..

I put this code into the test.js file:

<script type="text/javascript">
<!--
function loadTC() {
document.write("This is a test.")
}
// -->
</script>


And in the actual page that I want to load this file, test.html, I put this code into the body:

<script language="JavaScript" src="http://www.jetclik.com/test.js"> </script>

It's still not working. You can view by going to http://www.jetclikc.om/test.html
planeboy7e7 is offline
Reply With Quote
View Public Profile
 
Old 01-10-2005, 08:21 PM
Experienced Talker

Posts: 45
Trades: 0
Oopps, what I meant to say was I put:

<script language="JavaScript" src="http://www.jetclik.com/test.js"> </script> into the header of test.html

and put <body onLoad="loadTC"> into the body tag.
planeboy7e7 is offline
Reply With Quote
View Public Profile
 
Old 01-11-2005, 08:09 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
If the document you want to include is XHTML compliant, you can use the MSXML ActiveX Object in JavaScript to retreive the document from a remote server then display it how you want.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Reply     « Reply to JavaScript includes
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35216 seconds with 12 queries