This is a stupid noob issue that just pisses me off .. sorry.
- This works:
alert('hello'); - This works:
alert(getsomestring()); - This works:
alert('hello'+'goodbye') - So why doesn’t this work:
alert('hello'+getsomestring());
I tried these with no luck:
alert('hello'+getsomestring(););
alert('hello'+getsomestring().toString(););
thanks.
using it as follows:
<script language="JavaScript">
function getQueryString() {
var assoc = new Array();
var queryString = unescape(location.search.substring(1));
var keyValues = queryString.split('&');
for (var i in keyValues) {
var key = keyValues[i].split('=');
assoc[key[0]] = key[1];
}
return assoc;
}
</script>
<script language="JavaScript">
alert('?h='+getQueryString()["search"];);
//localSearchHighlight('?h='+getQueryString()["search"]);
);
</script>
Your code has syntax errors, in the second
<script>block. It should read:;inside the function call parens.);after your comment.Other than that, it seems to work like you want it too.