Triggering jQuery on an opener window

0 votes

I am opening a dialog window from a main window. The dialog is used to upload a file. When it is complete, I want the dialog to trigger a jQuery function in the opener window. Seems like this should work, but so far it's not.

in the main window I am opening the dialog like this:

jQuery('.modaldataupload').click(function() {
    var newwindow = window.open(jQuery(this).prop('href'), '', 'height=400,width=500,top=200,left=200');
    if (window.focus) {
        newwindow.focus();
    }

That works. The upload takes place using php, that works, and the dialog is redirected to a confirmation page that has this in it:

<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#datauploadslist', window.opener.document).val('hello');
});
</script>

In the main window, I have a div:

<div id="datauploadslist"></div>

Shouldn't I get "hello" in that div?

Aug 3 in Web Development by gaurav
• 17,580 points
9 views

1 answer to this question.

0 votes

try:

window.opener.$('.abc').trigger('click') 
answered Aug 4 by rajatha
• 7,040 points

Related Questions In Web Development

0 votes
1 answer

Date range picker on jquery ui datepicker

Thanks I need this kind of code. ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,040 points
48 views
0 votes
1 answer

Why use jQuery on() instead of click()

The . on() method attaches event handlers to ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,040 points
9 views
0 votes
1 answer

How to Fade In/Out multiple texts using CSS/jQuery like on Droplr?

The jQuery fadeIn() method is used to ...READ MORE

answered Jun 29 in Web Development by rajatha
• 7,040 points
11 views
0 votes
1 answer

How to change an element's title attribute using jQuery

You can change the title attribute with ...READ MORE

answered Jun 30 in Web Development by rajatha
• 7,040 points
17 views
0 votes
0 answers

Javascript - Window open, use CDN

Simple question. I cannot get a new ...READ MORE

Jul 20 in Web Development by gaurav
• 17,580 points
5 views
0 votes
1 answer

How to open another window using PyQt

Switch between self.hide() and self.showMinimized() def start(self): ...READ MORE

answered Oct 1, 2018 in Python by Priyaj
• 58,080 points
11,982 views
0 votes
1 answer

How to use jquery with asp.net ajax?

If you weren't aware, Microsoft is planning ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
190 views
0 votes
1 answer

Is 'sparkline' a method?

I suggest you to check 2 things That jquery.sparkline.js is actually ...READ MORE

answered Nov 9, 2018 in Apache Spark by Frankie
• 9,830 points
600 views
0 votes
1 answer
0 votes
1 answer

Jquery trigger only on small window

You have the :hover pseudo on your CSS. While ...READ MORE

answered Aug 4 in Web Development by rajatha
• 7,040 points
11 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP