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, 2022 in Web Development by gaurav
• 23,260 points
1,266 views

1 answer to this question.

0 votes

try:

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

Related Questions In Web Development

0 votes
0 answers

Using jQuery to countdown from 90 seconds beginning on the click of an element

Hi I was wondering if anyone can ...READ MORE

Aug 22, 2022 in Web Development by gaurav
• 23,260 points
529 views
0 votes
1 answer

Date range picker on jquery ui datepicker

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

answered Jun 27, 2022 in Web Development by rajatha
• 7,680 points
4,927 views
0 votes
1 answer

Why use jQuery on() instead of click()

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

answered Jun 27, 2022 in Web Development by rajatha
• 7,680 points
435 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, 2022 in Web Development by rajatha
• 7,680 points
1,429 views
0 votes
0 answers

Javascript - Window open, use CDN

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

Jul 20, 2022 in Web Development by gaurav
• 23,260 points
534 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,020 points
13,878 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
747 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
1,270 views
0 votes
1 answer

Jquery pickatime, Drop down window not closing after on change event

Maybe your input element falls within label ...READ MORE

answered Aug 2, 2022 in Web Development by rajatha
• 7,680 points
549 views
0 votes
1 answer

Jquery trigger only on small window

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

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