javascript - Need Parent Buttons Outside iFrame to Call JS Functions Loaded Inside the iFrame -


this weird question , hate iframes, using phonegap , codiqa mobile application development , codiqa outputs html , outside forms want incorporate within codiqa's html loads in iframes. codiqa uses div id referencing when click menu item, loads page id in html , in parent window loads iframe inside div. also, parent window has own submit, reset, , buttons. need buttons call , use functions page loads within iframe...

apparently, exact opposite of how parent.myfunction() works, , wonder if possible or if need recreate code , not use iframes, clueless how can go that. php includes don't work have come find out... thanks! or maybe need move js files each form parent folders , have link forms separately? don't know... please advise. here example of 1 of page ids:

html (codiqa)

<a href="#page17" data-transition="flip">    extracting </a>  <div data-role="page" id="page17">         <div data-theme="a" data-role="header">             <h3>extracting</h3>         </div>         <div data-role="content">             <iframe src="extraction/extract_form.html"             name="cable_extraction_worksheet" class="contentiframe"></iframe>         </div>         <div data-role="tabbar" data-iconpos="left" data-theme="a">             <ul>                 <li>                     <a href="#page1" data-transition="flip" data-theme="" data-icon="arrow-l">                                 </a>                 </li>                 <li>                     <a href="#" data-transition="none" data-theme="" data-icon="minus">                   reset               </a>                 </li>                 <li>//this button, , js function need call onclick                     <a onclick="uploaddata();" data-transition="none" data-theme="" data-icon="check">                   submit               </a>                 </li>             </ul>         </div>     </div> 

iframe's js function

function uploaddata() {   //read of data page (eid in extractform) {     extractform[eid] = document.getelementbyid(eid).value; }         upload_extractform(); } function upload_extractform() { $.ajax({     type: 'post',     url: './php/upload_extractform.php',     data: extractform,     async: false,     datatype: 'text',     success: function() {         alert("thank you. extraction form has been submitted.");  },          error: function(jqxhr, textstatus, errorthrown) {         alert("error... " + textstatus + "\n" + errorthrown);     } }); }; 

i think looking for:

onclick="document.getelementbyid('cable_extraction_worksheet').contentwindow.uploaddata();"

is reliable?? doesn't work in browsers or function has jquery in it, of mine do. want verify, thanks.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -