[Javascript] Ajax question
tedd
tedd at sperling.com
Sat Dec 30 14:27:56 CST 2006
At 11:39 AM -0800 12/30/06, Paul Novitski wrote:
>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?
>
>
>Tedd,
>
>I suspect that your problem is indicated by your use of the
>expression "at the same time." Which do you want to occur first,
>the page refresh or the ajax request? Obviously the page refresh
>must come first, otherwise the ajax-delivered content will be
>obliterated by the page refresh.
>
>I suggest you explore this path: reload the page with a querystring
>that indicates the desired ajax request, then after page load have
>javascript collect the desired content. Something along the lines
>of http://example.com/testpage.html?ajax=rock
>
>Regards,
>Paul
Paul:
I see and have considered the timing difference. I should have said
"I want to use ajax to send a variable and then refresh the current
page, or a redirect to any other page."
I don't want to use the form
http://example.com/testpage.html?ajax=rock I have no problem
receiving the variable I want so there's no need for me to include
that variable in the url.
I want to use ajax in the manner of:
<a href="javascript:sndReq('rock');" >Rock </a>
You see, I can send "rock" that way via ajax with no problems.
What I can't do is via a single click refresh this page, or direct
the browser to another page, via a href or whatever.
I know this is hard to understand, but just simply consider this --
if the user clicks (The CLICK) this anchor --
<a href="javascript:sndReq('rock');" >Rock </a>
-- everything works. Now, how do I redirect the browser to another
page from the same user click (The CLICK)?
Thanks.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
More information about the Javascript
mailing list