Although i have another page that utilizes same function so i placed into a global file instead of keeping on page.
Activate JQUERY Document ready function only on specific pages in global javascript file
I have a drag and drop feature that is activated when particular page is open using the document method. As i understand it is fired every time on page load. I have now placed the code in a javascript file. The trouble is it will now load on all pages that access javascript file when i just want it to load when particular pages load, two?
var srcElement = '';
$(document).ready(function () {
2 answers
Sort by: Newest
-
-
Yijing Sun-MSFT 7,071 Reputation points
2021-09-30T02:20:13.9+00:00 Hi @peter liles ,
Why you don't put the javascript file in the specific pages instead of in the global? I suggest you could write the drag function in the javascript file and then you could reference the javascript file in the specific pages.Best regards,
Yijing Sun
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.