Hi,
I am having a lot of problems using Ajax to load content from other URL's in the sense that the URL in the address bar never changes, which of course causes strange behavior when refreshing the browser, going back and forward, goingdirectly TO a page, etc.
I am hoping that someone can explain to me what this whole concept of "www.mysite.com/mypage/myaction/" as opposed to just "www.mysite.com/mypage/" is? In the SS AJAX tutorial [ http://doc.silverstripe.com/doku.php?id=recipes:ajax_basics ]? I have a feeling this is related, is it not?
First of all, $('element_name').load(url) successfully loads my content fine completely WITHOUT any of the isAjax() code given in the tutorial, so I am not sure what this code is for.
Secondly, the tutorial says, "Above is an example of an action that can be called from your page. In the html it is shown how to call this action." However, there is no explanation of WHAT this action IS, and how to assign/define it.
I'm assuming that the whole idea with the "second part" to the URL ("www.mysite.com/mypage/myaction/") is to TELL Silverstripe that we are using Ajax, right? So how do I get the URL of page content I am loading into my current URL to "stack on" to my current URL as indicated by the /$page/$action concept? Does /$action MEAN the second part? The URL of the Ajax-called page?
I'm doing an image gallery. The URL is:
.../portfolio-web-interactive/
Then I click on a picture, using $('element_name').load('portfolio-wi-project-1');
How can I get the URL then to become:
.../portfolio-web-interactive/portfolio-wi-project-1
?
Isn't this the way it's supposed to work? Do I use urlParams to set this action or what?
Any help would be GREATLY and TRULY apperciated-- my whole site depends on this URL thing getting cleared up.
Thanks in advance,
Garrett