Can someone please tell me what i'm doing wrong..jquery help. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone please tell me what i'm doing wrong..jquery help.

Help help help

16th Feb 2020, 9:51 AM
He Ma
10 Answers
0
Share your code otherwise no one will be able to help you.
16th Feb 2020, 9:52 AM
Chetali Shah
Chetali Shah - avatar
0
<script> Function updateiframe() { var myframe = window.parent.$("iframe#frame4").contents().find('body'); Var textareavalue = $("textarea").val(); Myframe.html(textareavalue); }
16th Feb 2020, 9:55 AM
He Ma
0
I know i have typos ..but syntax wise ...i think thats my problem... it doesnt work ...smashing my head against the wall for a week now ... it hurts😭
16th Feb 2020, 9:57 AM
He Ma
0
why window.parent ? where's the function got executed from ? whats your code currently doing ? any error ? or nothing happen ?
16th Feb 2020, 10:24 AM
Taste
Taste - avatar
0
I have two iframes side to side within the main index html...left iframe has a texarea for input ; right iframe should be for text display / output... so i need to send input data from left iframe to right iframe... should have to go through parent index html which is housing both iframes... at least to get right iframe's ID... helppp...oh and this code is being executed from left iframe.
16th Feb 2020, 10:29 AM
He Ma
0
as u can see in the textarea below i have the oninput='updateiframe()' ... which should triggerthe function above... but nothing happens... so theres something im not doing right ... because it all works within an iframe...but i cant seem to be able to traverse the dom....😭😭😭😭 <body> <textarea rows="5" cols="50" oninput="updateIframe()" placeholder="Type text here..."></textarea> </body>
16th Feb 2020, 10:35 AM
He Ma
0
that's the information that you'll need in description when writing a question my friend i dont really use jquery, but try to debug every variable you're using. if you're not used with the tools console.log or alert veriables you're using will do
16th Feb 2020, 10:49 AM
Taste
Taste - avatar
0
Do you realize you didnt help????
16th Feb 2020, 11:41 AM
He Ma
0
😭😭😭😭😭😭😭😭😭 im frustrated... its that bad
16th Feb 2020, 11:41 AM
He Ma
0
try to console.log(myframe) whats the value, does html() exist in there, etc i did same thing without jquery as you can see there alot more than window.parent to get into second iframe <body> https://code.sololearn.com/WCyZ1T4nLGj3/?ref=app
16th Feb 2020, 12:07 PM
Taste
Taste - avatar