Здравствуйте
Подскажите пожалуйста в чем ошибка
в iframe загружаю скрипт xml с другого домена и javascript хочу пройтись по этому xml и получить весь содержащийся в нем текст, но ничего не работает, подскажите пожалуйста, в чем ошибка
<iframe src="http://www.ringcentral.com/api/index.php?cmd=getCountries&typeResponse=xml" id="iframe" width="600px" height="600px"></iframe>
<form id="form">
<input type="text" id="msg" value="Your Message" />
<input type="submit" />
</form>
<script type="text/javascript">
window.onload = function() {
var responseText=document.getElementById('iframe');
responseText.document.onload=getFrameContents();
}
function getFrameContents(){
var iFrame=document.getElementById('iframe');
alert(iFrame);
if ( iFrame.contentDocument )
{ // FF
alert(document.getElementById("iframe").contentDocument[0]);
}
else if ( iFrame.contentWindow )
{
iFrameBody = Frame.contentWindow.document.getElementsByTagName('body')[0];
alert(iFrame.contentWindow.document.getElementsByTagName('body')[0])
}
}
function my_func(obj)
{
alert(obj);
}
alert выдает undefine такое ощущение, что фрейм js видит, но асе что в нем для js - пусто, как будто загружается мусто фрейм
вот адрес сайта
http://mulan.com.ua/
Возможно мне стоит создавать iframe так же с помощью javascript ,а не html ?