1
我有一些網頁將使用URL的路徑部分文本放置在頁面上,像這樣..的JavaScript文件撰寫VS的jQuery replaceWith
urlPath=window.location.pathname;
urlPathArray = urlPath.split('/');
urlPath2=urlPathArray[2];
if (urlPath2 == "sometext")
{
document.write("Title for Some Text")
}
else if (urlPath2 == "othertext")
{
document.write("Title for Other Text")
}
else
{
document.write ("Generic Title")
}
是否值得搞清楚如何做到這一點與jQuery和replaceWith函數?
值得搞清楚如何做到這一點沒有'document.write'。 –