wrapped in a function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2015 06:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2015 06:35 AM
I am not sure what this means - I currently have the issue that when I use the 'add attachment' UI that is a tthe bottom of my screen, it clears out all the fields that have been completed on the change record.
Strangely the same UI action at he top of the screen works perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2015 11:35 AM
The way that client side code works is that when a page loads, any code that is set up to be called, will be called. Whatever code is not wrapped in a function will be called on page load. When you wrap your code in a function, then you are telling the browser that it shouldn't run the code until that specific function is called.
Runs every time:
alert('I run on page load!');
Runs every time:
callAlert();
function callAlert(){
alert('I run on page load!');
}
Runs only when you call it from elsewhere:
function callAlert(){
alert('I do not run on page load!');
}
Does that help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 08:00 AM
Casey, thanks - I have sorted the probelm . John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 08:33 AM
Awesome! Will you either post the solution or mark a reply as the right answer? That way it will close off this thread and give guidance to those who will read this in the future.