Jeremy Keith 04 December 2011 David Goss wrote: “Only thing I’d add would be to hijax the link to trigger searchNews when clicked rather than taking you off-page.” Excellent idea! You’d still only need to write the Ajax code once, but you’d simply change the event that triggers it based on viewport size: On a large viewport, trigger the Ajax request once the page has loaded. On a smaller viewport, trigger the Ajax request when the link is clicked. I like it!
David Goss wrote: “Only thing I’d add would be to hijax the link to trigger searchNews when clicked rather than taking you off-page.”
Excellent idea! You’d still only need to write the Ajax code once, but you’d simply change the event that triggers it based on viewport size:
On a large viewport, trigger the Ajax request once the page has loaded.
On a smaller viewport, trigger the Ajax request when the link is clicked.
I like it!