Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: phranque

Message Too Old, No Replies

Linking to 'Text' on a different web server

Is this possible?

     

Bowdii

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

10+ Year Member



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

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

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



>> 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

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

10+ Year Member



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

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

10+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month