سؤال

I currently have kind of a toolbox for a website, separated in various files that do different things to different parts of the page.

For example: one script runs on www.idk.com, another runs on www.idk.com/article/*, so on so forth.

What I want is a way to dispatch the execution of each script to bundle everything in one package. This package would run on all www.idk.com and decide which scripts to execute based on the URL.

هل كانت مفيدة؟

المحلول

Why not just use regex-matching on the value of location.href?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top