By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,517 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,517 IT Pros & Developers. It's quick & easy.

cross domain communication on enter key press

P: 7
hello ,

Cross-Domain Communication Between IFrames

in this script they have included 2 iframes. parent can send a message to both iframes and frames can send massage to each other.

they have called the function at particular event . I don't want to call the function at particular event.(they have sent the message at button (sentbtn) click event) .


in My example i have 2 or more text box these are generated dynamically . and when user will write some thing in text box, will press the enter button that time i want to call the javascript function that is present in another iframe (domain is different).....

code is really complicated to understand .......

note: iframe domain is not same
text box id is not same. id is generated dynamically.

help me out to solve this ....
Jan 9 '09 #1
Share this Question
Share on Google+
1 Reply


xNephilimx
Expert 100+
P: 213
From what you're saying, I guess it's just a matter of changing the event that fires the action. In the original script the do it on submit, you can do it on keyup and if the key is 13 (enter) it will call the proper function.


Expand|Select|Wrap|Line Numbers
  1. window.onkeyup = function( e ) {
  2.     if( !e ) var e = window.event;
  3.     var key = e.keyCode ? e.keyCode : e.which;
  4.  
  5.     if( key == 13 ) {
  6.         //do what you have to do in here
  7.     }
  8. }
  9.  
Jan 9 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.