problem of using ajax

edited October 2012 in Feature Requests
I wanna use ajax to update content when clicked a link to instead of traditionally refresh fullpage, and my method is prepend a #! fragment to the controller segment of anchors href attr such as home and news , to prevent the http request and have ajax crawling, then use js to implement the ajax task, these are what i have done, but now i got a problem is if i access the url directly, maybe mysite.com/#!news, it load index page and ignore queries after # fragment, so what can i do to solve this? thx.

Comments

  • edited 11:51PM
    Is there a base url in the head tag of your page?
  • edited 11:51PM
    yes, i put a tag in head.
  • edited 11:51PM
    This sounds more like a javascript issue. Is your code properly executing on page load to grame the news hash value?
  • edited October 2012
    Yes, js is loaded without error. I type mysite.com/#!news or #!home or whatever in browser, will load index page (home.php), but since entered the page, and clicked links just like #!news, it worked properly. I looked through the routes, redirects, Page router, My_url_helper, and I have no idea to do anything.
  • edited 11:51PM
    I ll continue tmr that here is 3am now.. thx for ur help
  • edited 11:51PM
    Is your view being served up by a custom controller or through the default page router controller (fuel/modules/fuel/controllers/views/page_router.php)? Also, can you browse to that view file normally as well like at mysite.com/news?
Sign In or Register to comment.