0

Is it possible to automatically reveal hidden div when loading an external page? Redirected page has a div (date picker)that is by default hidden under a link:

   <a class=" this-link" data-bind="fadeVisible: !isVisible(), click: change">Change</a>

On click the div is visible and link disappears.

It is set similarly to this example:

    < button>show and hide</button>
      <div id="mydiv"></ div >

#mydiv{
width:300px;
height:300px;
background:red;
display:none;
    }

$('button').click(function(){
  $('#mydiv').toggle('slide',500)
   })

But i wish to have this immediately open (show ) on page load and, link to hide on click.

This 3th party tool is implemented to a page trough a widget. I tried adding this example to a widget HTML code:

$(".change").show()
$('.change').css('display','block');

But its not working.

Can this be revealed trough JS or any other way? Thank you.

Temani Afif
  • 180,975
  • 14
  • 166
  • 216
Peka Car
  • 1
  • 1
  • Why not using onload event ? – Bertrand May 18 '18 at 21:10
  • When you mean "loading", do you mean referencing it in the titular iframe? If so, that's an external site. There are specific cross site scripting rules in place to prevent that sort of thing, for very good reasons. – Paul Alan Taylor May 18 '18 at 21:16
  • nope. the onload event on frame – Bertrand May 18 '18 at 21:20
  • You're loading it through iframe ? A parent page can access frame elements : https://stackoverflow.com/questions/1088544/get-element-from-within-an-iframe. OK. Just see it is external site. No way to do stuff in this case unless acting in external site – Bertrand May 18 '18 at 21:20

1 Answers1

1

You simply CANT

because of XSS policy in all browsers.