Append to URL and refresh page
this should work (not tested!) var url = window.location.href; if (url.indexOf(‘?’) > -1){ url += ‘¶m=1’ }else{ url += ‘?param=1’ } window.location.href = url;
this should work (not tested!) var url = window.location.href; if (url.indexOf(‘?’) > -1){ url += ‘¶m=1’ }else{ url += ‘?param=1’ } window.location.href = url;
In Java or JavaScript: driver.navigate().refresh(); This should refresh page.
You can do it with PHP: header(“Refresh:0”); It refreshes your current page, and if you need to redirect it to another page, use following: header(“Refresh:0; url=page2.php”);
To strictly answer the question: Use invalidate(): public void invalidate () Since: API Level 1 Invalidate the whole view. If the view is visible, onDraw(Canvas) will be called at some point in the future. This must be called from a UI thread. To call from a non-UI thread, call postInvalidate(). ViewGroup vg = findViewById (R.id.mainLayout); … Read more
I don’t know if the ChangeDetectorRef was required when the question was created, but now this is enough: import { MatTableDataSource } from ‘@angular/material/table’; // … dataSource = new MatTableDataSource<MyDataType>(); refresh() { this.myService.doSomething().subscribe((data: MyDataType[]) => { this.dataSource.data = data; } } Example: StackBlitz
It is up to the browser but they behave in similar ways. F5 usually updates the page only if it is modified. Modern browsers sends Cache-Control: max-age=0 to tell any cache the maximum amount of time a resource is considered fresh, relative to the time of the request. CTRL–F5 is used to force an update, … Read more
Try adding a cachebreaker at the end of the url: newImage.src = “http://localhost/image.jpg?” + new Date().getTime(); This will append the current timestamp automatically when you are creating the image, and it will make the browser look again for the image instead of retrieving the one in the cache.
Call notifyDataSetChanged() on your Adapter object once you’ve modified the data in that adapter. Some additional specifics on how/when to call notifyDataSetChanged() can be viewed in this Google I/O video.
Use location.reload(). For example, to reload whenever an element with id=”something” is clicked: $(‘#something’).click(function() { location.reload(); }); The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false, so by default the page may reload from the … Read more