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'。 –