I am using a 3rd party app and they have a JS variable hard coded into their HTML that I need to change / update with Javascript OR jQuery, both are available to use.
The 3rd party app has variables hard coded into the page:
<script type="text/javascript" charset="utf-8">
var order_poNumber = "";
</script>
Which gets updated when a user selects a value from a dropdown (my dropdown, not 3rd party):
<script type="text/javascript" charset="utf-8">
var order_poNumber = "32380080-64060";
</script>
But the issue is that the value sticks for some reason. If you go to another page and come back (not using the back button, but by going to a different page then clicking a link to return to the order page where this issue is happening) the value is still set to 32380080-64060 but I need it to be blank as it originally was.
I've tried:
function resetPO(){
order_poNumber = "";
}
window.onload = resetPO();
And a few other variations of that, but it won't work.
I have to do the JS from an external JS file BTW.
Any ideas?
I am looking for a way to overwrite the value that is stored in the variable order_poNumber in the JS script block that is hard coded in the HTML. Ideally I want some kind of late or even delayed JS to come in and overwrite the value once the page has loaded. There are a lot of steps in how that number gets there once selected from the dropdown (AJAX, ActiveX, JS, jQuery, and a mix of 3rd party app and my own codes and functions) which took a lot of work to get working properly so I don't want to mess with all of that anymore.