LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-19-2004, 04:11 AM   #1
NeptunEz
Member
 
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52

Rep: Reputation: 15
inserting html into html


Is there any way to insert full html-page into other page?

I want to insert a dynamic text produced with a script into my LiveJournal page...
 
Old 12-19-2004, 07:09 AM   #2
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Rep: Reputation: 30
Does your server support ASP, PHP or JSP?, what is your server?

If not, you could settle for some tacky, but functional javascript..

Code:
<HTML>

<HEAD>
<SCRIPT language='JavaScript'>

 function include(url)  // must be a fully qualified URL, I don't know why
 {
   if ( document.all )
   {
     var xml = new ActiveXObject("Microsoft.XMLHTTP");
     xml.Open( "GET", url, false );
     xml.Send()
     document.writeln(xml.responseText);
   }
   else  // Netscape code from http://www.experts-exchange.com/java....20290896.html
   {
     if ((location.host=='' && url.indexOf(location.protocol)==-1) || url.indexOf(location.host)==-1)
     {
       netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect");
     }

     var dest = new java.net.URL(url);
     var dis  = new java.io.DataInputStream(dest.openStream());
     var res  = "";
     while ((line = dis.readLine()) != null)
     {
       res += line + java.lang.System.getProperty("line.separator");
     }
     dis.close();
     document.writeln(res);
     return res;
   }
 }

</script>
</head>

<BODY>
<BR><B>See the included file below:</B><BR>

&nbsp;<p>

<TABLE border="1">
<TR>
<TD>
<SCRIPT language='JavaScript'>
   // must be a fully qualified URL -- can be any type of file (html,jsp,asp,etc)
   include("http://www.yourserver.com/yourpage.html");
</SCRIPT>
</TD>
</TR>
</TABLE>

</body>
</html>
^^ Code stolen from experts exchange @ http://www.experts-exchange.com/Web/..._21142057.html
 
Old 12-19-2004, 07:18 AM   #3
NeptunEz
Member
 
Registered: Dec 2003
Location: Russia, Moscow
Distribution: Fedora Core 4
Posts: 52

Original Poster
Rep: Reputation: 15
Not my web server in fact

Thx, great example
 
  


Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge Of Html Files Into A Single Html (or Pdf) fiomba Linux - Software 6 06-20-2011 07:28 PM
html code and including html files Hockeyfan Programming 2 08-22-2005 05:11 PM
Autorun a .html file on inserting a DVD ilhbutshm Linux - Software 10 04-20-2005 11:07 AM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 05:06 AM
HTML Guru's or website Geeks (anyone who knows html) MasterC General 6 07-05-2002 01:59 PM


All times are GMT -5. The time now is 03:42 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration