FT3 Posted January 31, 2012 Report Share Posted January 31, 2012 Sveiki taka no js vispar neko nejedzu , prasu jusu palidzibu :) Ka šim kodam pielikt width un height lai rada to iframe ? width un height ir nepieciešams lai parbauditu scripta darbibu , jo tgd viņš itka ielade bet neko nerada . <script>var rs_id=MANS ID;</script> <script> var vote_hd = document.getElementsByTagName('head')[0]; var vote_tag = document.createElement('iframe'); vote_tag.src = 'http://manalapa.lv?p=' + rs_id; vote_hd.appendChild(vote_tag); </script> iepriekš tnq Quote Link to comment Share on other sites More sharing options...
0 daGrevis Posted January 31, 2012 Report Share Posted January 31, 2012 http://stackoverflow...sing-javascript Starp citu... kāpēc tev `rs_id` ir definēts citā `<script />` tagā? Vispār labāk uztaisi atsevišķu JavaScript failu un raksti visu tur... pašam vieglāk. Quote Link to comment Share on other sites More sharing options...
0 FT3 Posted January 31, 2012 Author Report Share Posted January 31, 2012 (edited) jo gala rezultata man vajadzes panakt ta <script>var rs_id=UNIQ ID;</script> <script src="http://manalapa.lv/krutajs.js"></script> pieliku to width un height lkm nepreizi , tik un ta neko nerada . <script> var vote_hd = document.getElementsByTagName('head')[0]; var vote_tag = document.createElement('iframe'); vote_tag.width = '300'; vote_tag.height = '300'; vote_tag.src = 'http://manalapa.lv?p=' + rs_id; vote_hd.appendChild(vote_tag); </script> Edited January 31, 2012 by FT3 Quote Link to comment Share on other sites More sharing options...
0 daGrevis Posted January 31, 2012 Report Share Posted January 31, 2012 Pamēģināji `setAttribute()`? Quote Link to comment Share on other sites More sharing options...
0 FT3 Posted January 31, 2012 Author Report Share Posted January 31, 2012 Pamēģināji `setAttribute()`? pirmstam jav biju meginajis http://www.dyn-web.com/tutorials/iframes/ Izdomaju daudz vieglaku variantu ;] <script>var rs_id='MANS ID';</script> <script> var rs_w='300'; var rs_h='300'; document.write('<iframe src="http://manalapa.lv?p=' +rs_id + '" width="' +rs_w + '" height="' +rs_h + '"></iframe>'); </script> Quote Link to comment Share on other sites More sharing options...
0 FT3 Posted January 31, 2012 Author Report Share Posted January 31, 2012 tā kā vai nu piemet style vai ar setAttribute().. šo papetišu velak , vnk vajadzeja steidzami. Quote Link to comment Share on other sites More sharing options...
0 Grey_Wolf Posted January 31, 2012 Report Share Posted January 31, 2012 (edited) ja ieseto ar JS tad jānorāda mērvienības vote_tag.STYLE.width = '300Px'; vote_tag.STYLE.height = '300Px'; piedevām iepriekš jābūt norādītam CSS atribūtos style="width=100;" ( nu kautvai 0 ), ja veido no jauna, vai nav norādīts, tad tas ir jāieseto ar setAttribute() Edited January 31, 2012 by Grey_Wolf Quote Link to comment Share on other sites More sharing options...
0 daGrevis Posted January 31, 2012 Report Share Posted January 31, 2012 Ir kāds iemesls kāpēc tu neizmanto kādu librariju? Piemēram jQuery: vote_tag.css({ width: 300, height: 300 }); Vienkārši atvieglos tavu dzīvi! :) Quote Link to comment Share on other sites More sharing options...
0 indoom Posted January 31, 2012 Report Share Posted January 31, 2012 Interesanti, kāpēc iframe tiek likts <head> blokā? Tam ir kāds īpašs iemesls? Quote Link to comment Share on other sites More sharing options...
Question
FT3
Sveiki taka no js vispar neko nejedzu , prasu jusu palidzibu :)
Ka šim kodam pielikt width un height lai rada to iframe ?
width un height ir nepieciešams lai parbauditu scripta darbibu , jo tgd viņš itka ielade bet neko nerada .
iepriekš tnq
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.