Welcome to WebmasterWorld Guest from 54.147.220.66

Forum Moderators: open

Message Too Old, No Replies

GET /javascript:history.back(1)

To what end?

   
2:07 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



(Rude, or otherwise ignorant responses will be summarily ignored.)

Q: Why would this line "GET /javascript:history.back(1)" show up in access_log files as a 404?

Pendanticist.

2:18 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could it be that the page that contains the javascript was accessed directly
when opening the browser; not having any page to go back to?

Or the back page might have timed out?

2:22 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm... really tempting to say "Rude, or otherwise ignorant posts will be summarily ignored" Hehehe ;)

But to be more helpful, the answer is that the page can't be found ;) and should never have been requested. The question is not why is it showing up in the logs as 404, but why is it showing up at all. Instead of requesting the page "/javascript:history.back(1)", the browser client should have interpreted the javascript statement, and requested the page's url. So you probably have a bug in the javascript of the page (or a buggy browser).

Shawn

[added: Oops, I posted before refreshing my browser, so i thought my post would be #2... My first comment (the bit of levity) was not refering to fashezee's post in any way)]

[edited by: ShawnR at 2:34 pm (utc) on Aug. 21, 2003]

2:25 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Oops, ShawnR got it first.

Yep, the parsed js should be reflected in the GET. And for pages accessed directly with no history the script simply does not execute and doesn't whow up as an entry in the logs.

4:04 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The other option is that somewhere on your site you have:

<a href="/javascript:history.back(1)">back</a>

What UA is associated with this log entry?

4:32 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It can also happen when user opens a page in a new window from javascript link
5:17 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member



It can also happen when user opens a page in a new window from javascript link

I never realized that, didn't ever think to test it. I've never seen any except the standard 'back' scripts. Do you happen to know if there are any that take this into account? Or if it's something that just has to be lived with?

Jim

5:48 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The "/" char. is not an escape; it is treated as a valid file character. Someone was playing around in the address bar and didn't delete the "/" so the browser didn't know it was JS and requested it as a filename. That would be my guess.

Jordan

6:38 pm on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use <!--#echo var="REFERER"--> and place it in the "href" section. But if user has disabled referer then you are out of luck. IMO just leave it up to the user and standard browser interface.

"/" char comes naturally with HTTP request, that is the way HTTP works.

GET / - gets the root of the server

You can't request "GET mypage.html" - there has to be a full path to the root of the server. I am assuming you had a link that was using javascript and when user clicked it, browser thought it was originated from the root and added a slash in front of it for a valid HTTP request.