Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all, I'm working on an AJAX site, and I'm using Dojo and Mootools (both Javascript) to provide some interactivity. Dojo has a back button fix, but it requires the use of of a string added onto a URL (I.e. www.site.com/pages/ becomes www.site.com/pages/#page1). I want to harness this function to allow you to go back to the page you were on. Since AJAX does not reload a page, a PHP script would only be called when someone did something to reload the page, such as hitting the back button. I have tried a few different $_SERVER variables, but none will give me the "#page1", only the URL up until that point. Can anyone think of a way to grab the entire URL, with the # modifiers? Thanks in advance, Matt White
Post Follow-up to this messageOn Mar 24, 4:22 pm, "Matthew White" <mgw...@msn.com> wrote: > Hi all, > > I'm working on an AJAX site, and I'm using Dojo and Mootools (both > Javascript) to provide some interactivity. Dojo has a back button fix, bu t > it requires the use of of a string added onto a URL (I.e.www.site.com/pages/beco mesw...om/pages/#page1). I want to harness > this function to allow you to go back to the page you were on. Since AJAX > does not reload a page, a PHP script would only be called when someone did > something to reload the page, such as hitting the back button. I have tri ed > a few different $_SERVER variables, but none will give me the "#page1", on ly > the URL up until that point. Can anyone think of a way to grab the entire > URL, with the # modifiers? > > Thanks in advance, > Matt White Matt, Interesting problem. I'm not sure if the #page1 gets stripped at HTTP...but I am recreating the issue on my server as well.... Any way you can overload that method and change that page value to a GET value? Then your PHP will receive the value and act accordingly. I would love to hear what your eventual solution is, though. Regards, Steve
Post Follow-up to this messageThe problem with a GET value will reload the page- something that I don't want to do with an AJAX site. Only a # value won't force a reload. Matt "ELINTPimp" <smsiebe@gmail.com> wrote in message news:2f922f39-f8a1-4bd2-9f15-22772e80f042@d62g2000hsf.googlegroups.com... > On Mar 24, 4:22 pm, "Matthew White" <mgw...@msn.com> wrote: > > Matt, > > Interesting problem. I'm not sure if the #page1 gets stripped at > HTTP...but I am recreating the issue on my server as well.... > > Any way you can overload that method and change that page value to a > GET value? Then your PHP will receive the value and act accordingly. > > I would love to hear what your eventual solution is, though. > > Regards, > > Steve
Post Follow-up to this messagehi , using jquery to over come the problem for the particular instance
Post Follow-up to this messageI'm sure jQuery is a decent framework, but I'm already using two (but both are superior in their own ways), and a third just seems like it would be awkward to implement, especially since it shares some of the same namespaces with Mootools. I'd like a way to implement this is one of the two frameworks I'm already using, or in PHP. Matt "Damodhar" <damu.be@gmail.com> wrote in message news:86051e11-e7d3-4fbf-97f4-c9f75ca47000@i29g2000prf.googlegroups.com... > hi , > > using jquery to over come the problem for the particular instance
Post Follow-up to this messageDamodhar's comment made me think, and I whipped up a piece of JavaScript that runs only one (when the page is loaded), and that seems to be accurately giving me the data after the #. Thanks for looking into the problem anyways! Matt "Matthew White" <mgw854@msn.com> wrote in message news:WwVFj.1751$Ew5.1390@trnddc04... > I'm sure jQuery is a decent framework, but I'm already using two (but both > are superior in their own ways), and a third just seems like it would be > awkward to implement, especially since it shares some of the same > namespaces with Mootools. I'd like a way to implement this is one of the > two frameworks I'm already using, or in PHP. > > Matt > > "Damodhar" <damu.be@gmail.com> wrote in message > news:86051e11-e7d3-4fbf-97f4-c9f75ca47000@i29g2000prf.googlegroups.com... >
Post Follow-up to this messageELINTPimp wrote: > On Mar 24, 4:22 pm, "Matthew White" <mgw...@msn.com> wrote: > > Matt, > > Interesting problem. I'm not sure if the #page1 gets stripped at > HTTP...but I am recreating the issue on my server as well.... The #page1 won't be sent to the web server, it's just something that the browser uses internally The request (seen in the url field) www.site.com/pages/becomeswww.site.com/pages/#page1 is sent as www.site.com/pages/becomeswww.site.com/pages/ -- //Aho
Post Follow-up to this message..oO(Matthew White) >I'm working on an AJAX site, and I'm using Dojo and Mootools (both >Javascript) to provide some interactivity. Dojo has a back button fix, but >it requires the use of of a string added onto a URL (I.e. >www.site.com/pages/ becomes www.site.com/pages/#page1). I want to harness >this function to allow you to go back to the page you were on. Since AJAX >does not reload a page, a PHP script would only be called when someone did >something to reload the page, such as hitting the back button. I have trie d >a few different $_SERVER variables, but none will give me the "#page1", onl y >the URL up until that point. Can anyone think of a way to grab the entire >URL, with the # modifiers? The fragment identifier is not part of the URI. The server will never see it. Micha
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.