communiccation teo between ifrmae

Discussion in 'JavaScript' started by kim.ray, Jul 14, 2008.

  1. #1
    hi,
    In my application i am having 2 iframe frame1 and frame2. And each one have a javascript file, frame1 have ifarme1.js and frame2 have iframe2.js frame1 is calling a function A() of iframe2.js and function A() have a for loop and in this loop it is calling another function of B().
    the function B is as follows :



    function B( usernamelist ) {

    user_id_list = (usernamelist.getAttribute('id'));
    user_name_list = (usernamelist.firstChild.data);
    var buddyList = parent.testFrame1.document.getElementById('buddylist');
    buddyList.innerHTML = buddyList.innerHTML + '<span id="'+user_id_list+'_blItem" class="view" onselectstart="return false;" onclick="'+" if(curSelectedc>0){var old=document.getElementById(curSelected+'_blItem');old.style.background='#fff';old.style.color='#333';};this.style.background='#47649a';this.style.color='#fff';curSelected='"+user_id_list+"';curuserName='"+user_name_list+"';"+'" ondblclick="if(curSelected.length>0){if(!document.getElementById(curSelected+\'_im\')){createIMWindow(curSelected, curuserName);imgping(curSelected);winList[curSelected].open();document.getElementById(curSelected+\'_sendBox\').focus();};};return false;"><img src="images/online.png" width="5" height="5" alt="" id="'+user_id_list+'_blImg" />&nbsp;'+user_name_list+'</span><br>';
    }




    by this code this is showing userlist in frame1.
    but when i click on a user this will not call a createIMWindow function.
    main prob in this code is "curSelected". is "curSelected" right ???

    plz sole my query.

    thanx
    i am waiting for your reply
     
    kim.ray, Jul 14, 2008 IP