Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Finding value after the # in a URL
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


Report this thread to moderator Post Follow-up to this message
Old Post
Matthew White
03-25-08 12:04 AM


Re: Finding value after the # in a URL
On 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

Report this thread to moderator Post Follow-up to this message
Old Post
ELINTPimp
03-25-08 12:04 AM


Re: Finding value after the # in a URL
The 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


Report this thread to moderator Post Follow-up to this message
Old Post
Matthew White
03-25-08 12:04 AM


Re: Finding value after the # in a URL
hi ,

using jquery to over come the problem for the particular instance

Report this thread to moderator Post Follow-up to this message
Old Post
Damodhar
03-25-08 12:04 AM


Re: Finding value after the # in a URL
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...
> hi ,
>
> using jquery to over come the problem for the particular instance


Report this thread to moderator Post Follow-up to this message
Old Post
Matthew White
03-25-08 12:04 AM


Re: Finding value after the # in a URL
Damodhar'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... 
>

Report this thread to moderator Post Follow-up to this message
Old Post
Matthew White
03-25-08 12:04 AM


Re: Finding value after the # in a URL
ELINTPimp 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

Report this thread to moderator Post Follow-up to this message
Old Post
J.O. Aho
03-25-08 09:03 AM


Re: Finding value after the # in a URL
..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

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Fesser
03-26-08 12:08 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 01:41 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.