Manipulate main frame from iFrame with jQuery?
iframe, javascript, jquery
Solution
Depending on where jQuery is loaded:
// jQuery is in the parent window
parent.$('#uploaded_files').append('<li/>').text(filename);
or
// jQuery is in the iframe
$('#uploaded_files', parent).append('<li/>').text(filename);
Problem
I am cheating a bit with iFrames to create an illusion of AJAX-uploading. When the upload is complete I need to communicate information about the file that was uploaded to the main frame and list it. If I have the following UL in the main frame and a JS-variable in the iFrame named filename, how can I append file_name to the list? ``` <ul id="uploaded_files"> <li>My_file_name.jpg</li> </ul> ```