本文介绍了菲德勒/ Jscript.NET:我如何追加一个字符串到特定的搜索查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
与下面code中的问题是,它在URL的最后
The problem with the below code is that it appends string at the very end of the URL
if (oSession.uriContains("search?q="))
{
var str = oSession.fullUrl;
var sAppend = "+test1+test2+test3";
if (!oSession.uriContains(sAppend))
{
oSession.fullUrl = str + sAppend;
}
}
所以,我怎样才能有条件的地方 +测试1 +测试2 + TEST3
旁边的搜索?Q =
?
感谢您
推荐答案
什么是与替换功能的问题:
What's the problem with replace function:
if (oSession.uriContains("search?q="))
{
var str = oSession.fullUrl;
var sAppend = "+test1+test2+test3";
if (!oSession.uriContains(sAppend))
{
oSession.fullUrl = str.replace( "search?q=","search?q="+sAppend);
}
}
这篇关于菲德勒/ Jscript.NET:我如何追加一个字符串到特定的搜索查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!