0
Can someone please tell me what i'm doing wrong..jquery help.
Help help help
10 Antworten
0
Share your code otherwise no one will be able to help you.
0
<script>
Function updateiframe() {
var myframe = window.parent.$("iframe#frame4").contents().find('body');
Var textareavalue = $("textarea").val();
Myframe.html(textareavalue);
}
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😭
0
why window.parent ?
where's the function got executed from ?
whats your code currently doing ? any error ? or nothing happen ?
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.
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>
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
0
Do you realize you didnt help????
0
😭😭😭😭😭😭😭😭😭 im frustrated... its that bad
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