lundi 25 janvier 2016

cross domain issues prevent action when reload parent page

its me...

i was wondering if you could help me with this issue on cross domain thing. i'm trying to reload the parent page from another domain. i achieved the reload on parent page when closing the child, but once i reload, the action on "onclick" event triggers again. my questions is how can i prevent window.open once it reloads?

see my code:

// here ive tried to put return false but it fails to prevent the popup

 <asp:HyperLink ID="HyperLink1" runat="server"  onclick="return myopen('http://ift.tt/20or9uJ', 'VieworUploadDocs','toolbar=no,location=no,directories=no,status=no,menubar=no,position=center,width=700px,height=850px');return false;" Text="Click Here" />

this is my script:

<script type="text/javascript">

         //open window
         var myWindow = null;
         var myTimer = null;

         myopen = function (url) {
             myWindow = open(url, 'VieworUploadDocs', 'toolbar=no,location=no,directories=no,status=no,menubar=no,position=center,width=700px,height=850px');
             myTimer = setInterval(function (e) {
                 if (myWindow == null || myWindow.closed) {

                     alert('Please wait while page loads.');
                     location.reload();
                     clearInterval(myTimer);
                     e.stopPropagation();
                 }
             }, 5000);
         }
         </script>

i tried to put this on my code

return false;
e.preventDefault();
e.stopPropagation();

thanks in advance hope anyone could help me. have a good day! struggle is real.

Aucun commentaire:

Enregistrer un commentaire