• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 404
  • Last Modified:

Populate form with data from different domain.

I have a web form. I have a need to populate some of the fields with data that is gathered from an XML page on a seperate server. Unfortuantely I do not have access to any server side languages - PHP, JAVA etc. I need to do this with just HTML and Javascript. Using AJAX doesn't work as its a cross domain call.
So if anyone has either a way round the AJAX issues or another method to doing it, let me know. Im open to all suggestions!
 
0
sam_cogan
Asked:
sam_cogan
  • 2
1 Solution
 
Michel PlungjanIT ExpertCommented:
If it is for yourself, you can bypass the ajax limit with browser security settings
Alternatively in IE you can save a webpage with extension .HTA which can be opened from your harddisk:

<html>
<head>
<script>
function loadXml(iFrame) {
  if (window.if1.location.href.indexOf('about')==0) {
    window.if1.location='http://www.w3schools.com/xml/note.xml'
    setTimeout('getXml()',2000)
  }
}
function getXml() {
  alert(window.if1.document.body.innerText);

}  
</script>
<body>
<iframe id="if1" application="yes" src="about:blank" onLoad="parent.loadXml(this)"></iframe>
</body>
</html>
0
 
sam_coganAuthor Commented:
Unfortunately it's not just for myself, and needs to work in both IE and firefox.
0
 
Michel PlungjanIT ExpertCommented:
Then you are Mickeyed.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now