[Javascript] Ajax question
Paul Novitski
paul at juniperwebcraft.com
Sat Dec 30 16:34:33 CST 2006
At 12/30/2006 09:24 AM, tedd wrote:
>I realize that ajax is used to circumvent full page refreshes, but
>what if you want to refresh the page AND use ajax at the same time?
...
>However, if I try to send AND refresh at the same time (i.e.,
>below), I cant. The following doesn't work:
>
> <a onclick="javascript:sndReq('rock');" href="" >Rock </a>
>
>nor
>
> <a onclick="javascript:sndReq('rock'); location.href='';" >Rock </a>
>
>nor
>
> <a onclick="javascript:sndReq('rock'); location.href='';" >Rock </a>
>
>nor
>
> <a href="javascript:sndReq('rock');location.href='';" >Rock </a>
>
>-- none work.
Oh, I think the problem is that the href is blank, which some (all?)
browsers won't act upon. Try:
location.href='?';
This will load the current page (whatever its url) with an empty querystring.
Paul
More information about the Javascript
mailing list