我遇到了一个javascript兼容性问题。这段代码可以在Chrome中运行,但不能在Firefox中运行。使用来自search-text的值并将其添加到搜索url的句子。
<a href="" onClick="this.href='http://localhost:8000/search?q='+search_text.value">
<input type="button" id="search-button" value="search"/>
</a>如果我删除+运算符,它也可以在firefox上运行:
<a href="" onClick="this.href='http://localhost:8000/search?q='">
<input type="button" id="search-button" value="search"/>
</a>所以我的问题是:如何将字段中的值添加到firefox上的url?耽误您时间,实在对不起。
发布于 2013-06-17 05:21:44
我知道了,谢谢你的帮助!(我将修复它,尼罗河,我正在从一个同事那里测试这段代码。)
<input type="button" id="boton-busqueda" value="Buscar" onClick="location.href='http://localhost:8000/search?q='+buscador_texto.value"/>https://stackoverflow.com/questions/17137620
复制相似问题