homepage Welcome to WebmasterWorld Guest from 54.227.146.68
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Linking to 'Text' on a different web server
Is this possible?
Bowdii




msg:669535
 8:47 pm on Mar 31, 2005 (gmt 0)

Hi all,

If you wanted to reference/link to a .jpg that was located on a different site, you would include www.website.com/images/logo.jpg

Now, I have a paragraph that I would like found on my partners sites, is it possible to reference it along the same way a picture is? If not, do you have any other reommendations for me.

Thank you for any help/advice!

 

txbakers




msg:669536
 10:09 pm on Mar 31, 2005 (gmt 0)

If it's a file available on someone's web accessible directory, you can link to it.

[edited by: txbakers at 6:44 pm (utc) on April 4, 2005]

Span




msg:669537
 10:21 pm on Mar 31, 2005 (gmt 0)

>> If it's a file ..

Maybe the easiest way is to make your partner sites link to a .js file that 'document.writes' your paragraph. Not really SE friendly though.

Bowdii




msg:669538
 6:02 pm on Apr 4, 2005 (gmt 0)

txbakers - I received a 404 when I hit your link.

Span - I have not done java in a long time, can you clarify a little more, or send me a link

Thanks for your quick respones!

HughMungus




msg:669539
 6:16 pm on Apr 4, 2005 (gmt 0)

Bowdii, you can include text from another site on your site, but, if you just want, say, a paragraph, it has to be defined in a separate include file. In other words, to answer your initial question, no you really can't include just some text from some other site without either copying it to your own site or having the site owner create a javascript include file to be included on your site. In the latter case, the Javascript include file is just a file that uses document.write to write some text that the other webmaster specifies. This is useful for stuff like advertising -- it's how Adsense works. Your server requests a file and the other server serves up a file with the info they want in it.

It's easy to do (usually referred to as a "Javascript include"). As an example, create a .js file that just writes a line such as:

document.write("This is some text you want to include on another site.")

Name that file "include.js".

Then on the site on which you want their text included, you do a javascript include statement:

<script type="text/javascript" src="http://www.othersite.com/include.js"></script>

One cool thing you can do is that if the other site has the information stored in a database, you can have them do a database call and put together an include file that includes data from the database.

Bowdii




msg:669540
 7:17 pm on Apr 4, 2005 (gmt 0)

HughMungus - Perfect! Thanks!

The database call sounds really neat! I did a search for some more information regarding this, but did not find anything to relevant. Do you have any relevant links?

Thanks again for you help!

HughMungus




msg:669541
 7:21 pm on Apr 4, 2005 (gmt 0)

Well, all you have to do if you want to do a database call to create the include file is just do the call and have it write out to a format that is OK for a .js file. Pretty easy.

Bowdii




msg:669542
 7:17 pm on Apr 5, 2005 (gmt 0)

HughMungus - I have discovered that there is a Security problem doing a javascipt include. Thanks anyways@!

Can SSI be read from a different site?

Any other solutions out there?

Thanks for any help!

markanthony




msg:669543
 7:32 pm on Apr 13, 2005 (gmt 0)

There is always an iframe.

I don't believe this to be too SE friendly either.

But it will take a html formated file from any other server on the net and present it in your page.

On the more complicated side you could use perl and lwp or curl, to grab the other page....HTML::TreeBuilder to rip out the parts you want and then send out the include.js format or just write your entire page dynamically.

This is not the optimal performance technique.

But another option.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved