473,396 Members | 2,009 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,396 software developers and data experts.

Can we get a response from outside the domian in ajax

Hi all,
can we get a response outside the domain using ajax? Eg. http://www.example.com/webService?list=test . then that may snd xml or json string to us.
var url ="http://www.example.com/webService?list=test ";
var myAjax = new Ajax.Request(
url,
{

method: 'get',
parameters: 'user=abc',
onComplete: function(response) {
res = response.responseText;
............................
and i want to display this response in my web page. we can simply do this by adding code like this
Eg. $("resp").innerHTML = res;

but when ajax call fires it saying this is unsafe in IE nothing happens in FF too. any solution for this??

Thank you,
samitha fernando
Aug 14 '07 #1
3 1330
acoder
16,027 Expert Mod 8TB
Samitha, welcome to TSDN!

Use a web proxy, e.g. see this link.
Aug 15 '07 #2
thanx for the reply. Yeah thatz a good way to get a ajax response from outside the domain. :) But i would like to know can't we do this by just using java script + or may be iframes :)
Thanx

samitha
Aug 16 '07 #3
acoder
16,027 Expert Mod 8TB
You could use JSON instead of HTML or XML. Another alternative is to use dynamic script tags.

Using iframes wouldn't work because you wouldn't be able to access the content of the iframe if it was from another domain.
Aug 16 '07 #4

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

Similar topics

4
by: Stu | last post by:
Hi, I need to push a .eml file (MS email pickup format) to the browser when the user clicks on a button. The file is outside of the web space so I used this method (which worked with word docs)....
12
by: petermichaux | last post by:
Hi, In my browser, I make an AJAX request. The server sends me a fragment of an HTML document. That fragment has some JavaScript inside some script tags. How do I run these scripts when the...
1
by: GSlusarek | last post by:
Hi all. I made AJAX call which return me a piece of javascript code. I trying to execute that code and I get that some global variables are not accesible. I mean i use prototype library and when i...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
10
by: trpost | last post by:
I am using ajax / php where I am looking up some info from the database and populating a select list dynamically, however I am running into some sort of size limitation with the ajax.response...
1
by: dan.goyette | last post by:
I'm fairly new to using AJAX. I'm currently developing a data grid application in coldfusion, using AJAX for paging/filter/sorting updates to the grid. So far I've just been returning raw html, and...
10
by: Daniel Loose | last post by:
hi dear folks, i'm new to ajax. simple request no problem - but it seems when I set the response handler function, I can only pass the function name and not give parameters, so I have a problem...
1
by: maildmz | last post by:
Goodafternoon, I have got a minimum Mongrel instance running (see ruby code) and i am hitting it with an Ajax request using Prototype. (see javascript code) I get the 'onLoading' event, but...
7
by: Jim in Arizona | last post by:
I'm brand new at ajax. In fact, about 20 minutes ago was the first time I got it to work. The problem I'm having on another page did not work, however. I'm running into the following error: ...
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:
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...
0
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,...

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.