如果我的URL包含单词“test”,我希望在我的网站上运行jQuery函数。
我要做的就是,如果我的URL包含“rest”字符串,则在页面上的元素中添加一个边距?
我已经添加了一个jsfiddle来展示我目前所做的。
$(document).ready(function(){
// How can I check to see if my url contains the word 'TEST' then run the below function?
$('.block-widget').css('margin-top, 252px')
});
window.location
并找到解决方案。 :D - omninonsense