473,511 Members | 13,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

EXTERNAL WEBSITE CONTENT

This page achieves the external website content using inline frames
http://www.anchorfx.com/forex/daily-...ction-bias.asp

can the same thing be done in javascript without using inline frames

if so how

--------------------------
http://www.eecpindia.com
http://www.anchorfx.com
*** Sent via Developersdex http://www.developersdex.com ***
Sep 5 '08 #1
1 1572
On or about 9/5/2008 18:05, it came to pass that preet wrote:
This page achieves the external website content using inline frames
http://www.anchorfx.com/forex/daily-...ction-bias.asp

can the same thing be done in javascript without using inline frames

if so how
Yes but you need create the Javascript on a server. Use PHP (or your
language of choice) to generate Javascript. This is perfectly legal and
avoids all the IFRAME issues for a foreign site.

On the page where you want content:
<div id='ContentDiv'>
<noscript><b>*****WARNING JAVASCRIPT IS DISABLED, IT MUST BE ENABLED TO
PROPERLY VIEW THIS PAGE*****</b></noscript>
....Loading data from Example.Com...
</div>
<script type="text/javascript"
src="http://www.example.com/Script.php"></script>

Script.php runs on your server, generates data or reads another web
site, then formats the result into a Javascript command that updates the
innerHTML of ContentDiv as follows:
document.getElementById('ContentDiv').innerHTML = 'Whatever you want';

you may bump into issues with some characters that cause the generated
Javascipt to fail. Here's how I fixed it (using PHP on server) assuming
the result is in $buffer
$buffer = str_replace("\\", "\\\\", $buffer);
$buffer = str_replace("\r", "\\r", $buffer);
$buffer = str_replace("\n", "\\n", $buffer);
$buffer = str_replace("'", "\\'", $buffer);
$buffer = str_replace('"', '\\"', $buffer);
return $buffer;


Sep 8 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1404
by: Bruce Arp | last post by:
I am in need of a little help with a form post. What I need to do is this: 1. Post a couple values to an external website form. 2. External website will process the values posted and if...
6
1324
by: Alex Nitulescu | last post by:
Hi. I have some documents (containing either plain text, either HTML) and I'd like to be able to show the contents on those files in different places on my website. The question is how do I show...
2
1244
by: MotorcycleIke | last post by:
I tried using WebRequest, but I am unable to simply redirect to an external aspx site and supply the userid and password and press their login button. I got the webrequest to populate a...
5
3612
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
5
10897
by: punchbag | last post by:
Hi all, There has recently been a new update to internet explorer whereby activex controls now load on a page unactivated. MSDN have a website explaining a workaround where you do away with the...
38
3964
by: Neo Geshel | last post by:
I am seeking a method to load one JS file directly into another, *without* having to dynamically write <scripttags. Is there any method whereby I can call only one external JS file using a ...
3
1822
by: RICHARD BROMBERG | last post by:
I have a simple program to test using an external .js file. This external file contains some functions that I need to call from several html programs. The program as written below works fine. ...
0
1330
by: Andrea Anastasescu | last post by:
Hi everybody, Inside the web.config of my application I have some custom sections. I have my own handlers for these sections, and their content is in external files. My problem is that...
6
61357
by: deknoopjes | last post by:
I want to display a specific area of an external website using iFrames. A year ago I created such code successfully, but lost this code due to a crashed computer. Googling for any solutions did not...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.