9295

refresh iframe from inside itself with different domains [duplicate]

<div class="question-status question-originals-of-duplicate">

This question already has an answer here:

    <li> How to refresh an IFrame using Javascript? <span class="question-originals-answer-count"> 13 answers </span> </li> </ul>

    i have a webpage which is housing my iFrame which is from a different domain. Now i have a button inside the iFrame which when pressed, needs to refresh or reload the iframe.

    I've tried a few methods which are blocked due to cross domain attempts..

    Answer1:

    In your script within the iframe, try this:

    document.location.href = document.location.href;

    You can't access elements outside of your document model from within the iframe, including accessing the iframe itself. You can access the properties of the document within it however.

Recommend

  • Is there a way to hide Trace Names in Plotly (specifically R)?
  • Async Controller not returning anything to the view when querying multiple datatable in parallel
  • How to assign a value to a tf.Variable in TensorFlow without using tf.assign
  • Dealing with commas in a CSV file in sqldf
  • Protractor testing in iframe in other non-Angular application?
  • C++ password masking
  • How to navigate between different html pages in Windows 8 Metro application using javascript?
  • Botframework - resize bot chat in width [duplicate]
  • How do I detect which submit button was pressed on a Zend Framework form?
  • ngFor youtube links with Domsanitizer in Angular2
  • Capturing HTML Text Input Key press after key has been applied?
  • django server code not updating
  • React Router and Arbitrary Query Params: Page Refreshes Unintentionally on Load?
  • WP7 difficulties binding data to listbox itemssource - won't refresh
  • Javascript Array, Object, Date not defined
  • Problem with Django using Apache2 (mod_wsgi), Occassionally is “unable to import from module” for no
  • Is there a way to dynamically embed PDF Files in a JSP pulled from the file system?
  • jwtBearer bearer token with rc-1 update to ASP.Net 5
  • Possible to get mouse events fired when cursor is outside page?
  • Low TTL with Leveled Compaction, should I reduce gc_grace_seconds to improve read performance withou
  • Silverlight DependencyProperty.SetCurrentValue Equivalent
  • Position: fixed nav does not stay fixed
  • Should I or shouldn't I use the CachingConnectionFactory with hornetq 2.4.1
  • Detect when Facebook like button is clicked
  • Content-Length header not returned from Pylons response
  • Email verification using google app script and google forms
  • Android fill_parent issue
  • Ajax Loaded meta Tags
  • Xamarin Forms - UWP Fonts
  • TFS: Get latest causes slow project reloading
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • jquery mobile loadPage not working
  • Jquery - Jquery Wysiwyg return html as a string
  • Properly structure and highlight a GtkPopoverMenu using PyGObject
  • Arrays break string types in Julia
  • WPF Applying a trigger on binding failure
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • How to set the response of a form post action to a iframe source?
  • How do you join a server to an Active Directory (domain)?
  • Java static initializers and reflection