473,394 Members | 1,709 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,394 software developers and data experts.

JavaScript retrieve external data

Hi,

I'm facing the following challenge. I am controlling a website on domain aaa (www.aaa.com) and one of the pages needs to use data which is retrieved from domain bbb (www.bbb.com).

In pseudo code I would like my html page on www.aaa.com to do the following:

while (forever) {
my VarData = ReadURL("http://www.bbb.com");
[Do something with VarData]
sleep 5; // (and then try again...)
}


From various posts on this forum I seem to have concluded that using an hidden iframe is the best thing to do but I can't get it to work because, IE-7 gives me "access denied" errors every time I go to www.bbb.com using this code:

var frame1=document.getElementById('iFrameBBB');
var iframeDocument = frame1.contentWindow ? frame1.contentWindow.document
: frame1.contentDocument;
var root = iframeDocument.documentElement || iframeDocument.body;
var HTML = root.innerHTML;


and iFrameBBB is declared as:

<iframe height="600" width="600" src="http://www.bbb.com" id='iFrameBBB' name='myiframe' >

Can anyone suggest a simple method achieving the above? The data on www.bbb.com is a simple line of text.... Thanks in advance for your help

Leon
Jul 9 '07 #1
5 3143
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

Use a server-side language instead to retrieve this information and then make AJAX requests to continuously get this information.
Jul 9 '07 #2
Thanks for your reply but I don't think that's going to work.. Domain www.bbb.com uses client side cookies to determine how it will reply to requests so a server side script would not be able to retrieve these.... Is there any other technolgy I could use you think? Flash, VB / Active X, Java Applet? I don't really care what it is as long as it will work.

Thanks

Leon
Jul 9 '07 #3
mrhoo
428 256MB
Domain www.bbb.com uses client side cookies to determine how it will reply to requests
Ajax calls usually need to be to and from the same domain.

You have to have administer rights both domains to have permission to read from one and write to the other, with server code.
Jul 9 '07 #4
Thanks. I seem to have tried every AJAX option now inclusive PHP-Proxy servers and it just doesn't work. If my research is correct - it appears that Flash is one of the few server side technologies which allows this so I guess I'll better find someone who can write this for me. I'll continue this discussion on the Flash forum!
Jul 10 '07 #5
praveen2gupta
201 100+
With Ajax and JavaScript you can not access outside your domain. Both works with in their Domain.I Think you need some server side Language to access the Data.
Jul 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: ICode | last post by:
Hi, all, I am currently updating links for a site almost daily. I have set the META tags to allow for no caching so that as soon as the site is updated on the server, the new changes can be...
4
by: Guillaume CABANAC | last post by:
Hi everybody, Does anybody know how to access a remote database (say Oracle) from JavaScript code (within a Firefox Extension) ? I know ADO via ActiveX in the IE world and think a similar...
12
by: weston | last post by:
I could swear that I've done this before, but suddenly, I seem to be unable to retrieve the values of CSS properties via Javascript. For example, take this document: ...
7
by: Bruno Alexandre | last post by:
Hi guys, Sorry about the off topic, but I can't find the ASP group just the ASP dot NET If I want to block a user to change a form after submiting, I add a function that will disable the...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
1
by: Joseph Scoccimaro | last post by:
I am using greasemonkey to create a script that allows one to analyze a web page. Currently I am trying to import the javascript from an external file to add to the DOM of a web page. It is...
1
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr =...
9
by: Phil_Harvey | last post by:
I am redoing my website and trying to get it to do something more exciting using Javascript. I did normal Java at university and code at work in VB.NET. I have got reasonably far into what I want...
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
4
by: James Pemberton | last post by:
I have recently created a ASP site utilizing Master Pages and all works fine until I want to proces my javascripts. Just to let you know, most of cliewnt side scripting is new to me. But...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.