1

I'm using the Chrome console using the snippet tool.

When I execute my code without the window.location.reload I can refresh the page manually and the code runs and selects the button I need it to. Is there any way to make it reload the page when I run the code, and subsequently run the function?

window.location.reload()
window.onload=stephen;

function stephen(){
    selectedValue('mills');
}
Božo Stojković
  • 2,893
  • 1
  • 27
  • 52
  • Welcome to StackOverflow! On topic: unfortunately console allows one to debug a **loaded** page, therefore your snippet won't run. Basically each page load is a new console session. There might be a workaround [here](https://stackoverflow.com/questions/16494237/chrome-dev-tools-modify-javascript-and-reload) – loa_in_ Jan 25 '19 at 16:57
  • Thank you for your reply is there any way i can do this in an external js file or will i have to use some sort of api for the website i am trying this on? many thanks. – Stephen James Mills Jan 25 '19 at 17:21
  • Try using an add-on called greasemonkey or some modern alternative – loa_in_ Jan 27 '19 at 11:19
  • Thank you will take a look many thanks – Stephen James Mills Jan 27 '19 at 16:19

0 Answers0