0

i am developing an MVC site which has many partials that are dynamically loaded. On my site i have a sort of taskbar which sits at the top of the site.

I would like to be able to access methods and properties from my 'taskbar' from any dynamically loaded script.. What is the best way to go about this?

I understand that it is in scope but is there some preferred way to do namespacing or what is the best practice for handling this kind of issue? thanks!

1 Answer 1

1

You need to scope it to the window usually, sometimes this needs to be explicit, sometimes it doesn't, for example:

window.Taskbar = {};

These should be available to use anywhere in your scripts (assuming they're logically in the same window).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.