我有一个功能,我需要出现在一个jQuery中$(document).ready(function() {}- 我是j't的javascript,但没有真正使用jQuery.我如何jQuerify这个功能?
function populateContext()
{
contextTxtBox = document.getElementById('searchContext');
pathArr = window.location.pathname.split( '/' );
contextTxtBox.value = pathArr[1].toUpperCase();
};
Run Code Online (Sandbox Code Playgroud)