Click here to Skip to main content
15,746,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to redirect from a home page to a separate map-page when a button is clicked. The redirect to the map-page happens successfully with history.push() but however the map-widget fails to load....When using window.location.assign(), the map-widget loads as the page refreshes...Is there anyway to accomplish this without refreshing the page but only through history.push()?

Code for map

<pre><ins class="bookingaff" data-aid="" data-target_aid="" data-prod="map" data-width="100%" data-height="590" data-lang="ualng" data-dest_id="0" data-dest_type="landmark" data-latitude="" data-longitude="" data-landmark_name="" data-mwhsb="1" data-address="">
    <!-- Anything inside will go away once widget is loaded. -->
        <a href="//"></a>
<script type="text/javascript">
    (function(d, sc, u) {
      var s = d.createElement(sc), p = d.getElementsByTagName(sc)[0];
      s.type = 'text/javascript';
      s.async = true;
      s.src = u + '?v=' + (+new Date());
      })(document, 'script', '//');

What I have tried:

By placing the code within the script tags inside the constructor of the map-widget react component the map loaded on the first click but once you go back and click the button again the map fails to load unless the home is refreshed again.
Updated 9-Jan-20 2:28am
Kornfeld Eliyahu Peter 9-Jan-20 10:40am    
You should ask the source...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900