473,390 Members | 1,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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 1561
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.