Article View: pl.comp.lang.javascript
Article #49973Re: odczytywanie zawartości iframa
From: Peter May
Date: Tue, 20 Apr 2010 21:59
Date: Tue, 20 Apr 2010 21:59
24 lines
1784 bytes
1784 bytes
W dniu 2010-04-20 23:42, Paweł Piskorz pisze:
> On 2010-04-20 22:01, Peter May wrote:
>> Żeby wykonać powyższe musisz ładować cały jQuery? Po co?
>>
>> var el = document.getElementById("save");
>> var ifr = document.createElement("iframe");
>> ifr.src = "http://192.168.4.40/CiscoWebService.asmx/HelloWorld";
>
> A fe! Jak już tak standardowo robisz, to setAttribute :P
W zasadzie jest to równoważne, choć jest zawsze "ale" :P
http://snook.ca/archives/snooksurvey/element_attributes_in_javascript/
>> var myframe = document.getElementById("iframeid");
>> var doc = (myframe.contentWindow || myframe.contentDocument);
>>
>> W zmiennej doc masz dostęp do zawartości iframe-a.
>
> Pod warunkiem, że strona ma uprawnienia do tego co w ramce.
Oczywiście :-) Trafna uwaga.
--
Peter
Technical Details
Message-ID:
<hql841$7d4$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.onet.pl!not-for-mailReferences:
<cf26ef3f-8ba4-40b5-af09-bf5156fe11ee@l37g2000vbd.googlegroups.com> <hql15u$dug$1@news.onet.pl> <hql74l$bk1$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.onet.pl!not-for-mail From: Peter May <peter.may@onet.pl> Newsgroups: pl.comp.lang.javascript Subject: Re: odczytywanie zawartości iframa Date: Tue, 20 Apr 2010 23:59:31 +0200 Organization: http://onet.pl Lines: 24 Message-ID: <hql841$7d4$1@news.onet.pl> References: <cf26ef3f-8ba4-40b5-af09-bf5156fe11ee@l37g2000vbd.googlegroups.com> <hql15u$dug$1@news.onet.pl> <hql74l$bk1$1@inews.gazeta.pl> NNTP-Posting-Host: 188.146.203.228.nat.umts.dynamic.eranet.pl Mime-Version: 1.0 X-Trace: news.onet.pl 1271800770 7588 188.146.203.228 (20 Apr 2010 21:59:30 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Tue, 20 Apr 2010 21:59:30 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pl; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 In-Reply-To: <hql74l$bk1$1@inews.gazeta.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit