473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

history.go(0); doesn't not work

I have a SAJAX login authentication script that, if the the correct
password is provided, returns "history.go(0)" to the page and I then
use "eval()" on the returned data to refresh it.

If the requested page has # in it (http://localhost/whatever/#), it
refreshes in Internet Explorer but not in Firefox. Any ideas why? Is
there a better way to refresh it?

Thanks.

Feb 24 '06 #1
5 6015
na************@msn.com said the following on 2/24/2006 10:49 AM:
I have a SAJAX login authentication script that,
What is "SAJAX"? I hope it's not Secure AJAX as nothing is secure about
AJAX. Or Scripting for that matter.
if the the correct password is provided, returns "history.go(0)" to
the page and I then use "eval()" on the returned data to refresh it.
You have my profound apologies that no one ever bothered to teach you
better than that. If you paid for the education that taught you that,
request a refund (if not demand it).

If the requested page has # in it (http://localhost/whatever/#), it
refreshes in Internet Explorer but not in Firefox. Any ideas why?
No music comes out of my speakers, any ideas why? The point is, you
aren't giving enough information. But that is not the problem. The
problem is that you are using the wrong approach to logging in.
Is there a better way to refresh it?


Yes. Use a form, submit the form, let the server return the appropriate
page.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 24 '06 #2
> What is "SAJAX"? I hope it's not Secure AJAX as nothing is secure about
AJAX. Or Scripting for that matter.


1. http://www.modernmethod.com/sajax/
2. the AJAX method is as "secure" as any "form submission". used with
SSL and a properly coded server script, there are no security concerns
if the the correct password is provided, returns "history.go(0)" to
the page and I then use "eval()" on the returned data to refresh it.


You have my profound apologies that no one ever bothered to teach you
better than that. If you paid for the education that taught you that,
request a refund (if not demand it).


this is my first time using JS and the ONLY reason why i would use it
is to work with XMLHTTPRequest.
If the requested page has # in it (http://localhost/whatever/#), it
refreshes in Internet Explorer but not in Firefox. Any ideas why?


No music comes out of my speakers, any ideas why? The point is, you
aren't giving enough information. But that is not the problem. The
problem is that you are using the wrong approach to logging in.


1. works fine in Internet Explorer
2. authentication is for everything beyond the /whatever/ point. "#"
just happens to be the
page requested by a user. regardless, "#12" or any other anchor value
doesn't work either.
Is there a better way to refresh it?


Yes. Use a form, submit the form, let the server return the appropriate
page.


this is not the design that I have for this particular feature.
everything works except for that refresh problem and instead of
suggesting a better solution to refresh the page (e.g. using "header"
and whatnot), you try to be all witty, yet fail miserably at it.

Feb 24 '06 #3
na************@msn.com said the following on 2/24/2006 3:33 PM:
What is "SAJAX"? I hope it's not Secure AJAX as nothing is secure about
AJAX. Or Scripting for that matter.
1. http://www.modernmethod.com/sajax/


http://www.ajaxtoolbox.com/

Will give you the same benefits, with an added one. Its free and it's
author post in this very newsgroup.
2. the AJAX method is as "secure" as any "form submission". used with
SSL and a properly coded server script, there are no security concerns
I disagree but it's irrelevant.
if the the correct password is provided, returns "history.go(0)" to
the page and I then use "eval()" on the returned data to refresh it.

You have my profound apologies that no one ever bothered to teach you
better than that. If you paid for the education that taught you that,
request a refund (if not demand it).


this is my first time using JS and the ONLY reason why i would use it
is to work with XMLHTTPRequest.


Nothing wrong with that. It's the use of eval that is the problem.
Especially when it's not needed. If you are returning script content to
the browser then create a dynamic Script element, insert the script
contents, and let the browser execute it.
If the requested page has # in it (http://localhost/whatever/#), it
refreshes in Internet Explorer but not in Firefox. Any ideas why?

No music comes out of my speakers, any ideas why? The point is, you
aren't giving enough information. But that is not the problem. The
problem is that you are using the wrong approach to logging in.


1. works fine in Internet Explorer


Internet Explorer isn't a good base reference for what works on the web
though.
2. authentication is for everything beyond the /whatever/ point. "#"
just happens to be the page requested by a user. regardless, "#12" or
any other anchor value doesn't work either.


If the script returns history.go(0) then it should refresh the browser.
If you don't want the page refreshed (which is what SAJAX's main selling
point appeared to me to be) then don't. Just set the
document.location.hash property. Not sure what your purpose of using the
hash is for though :\

Both of which truly defeat the purpose of the "AJAX" phenomenon -
non-refreshing browsing.
Is there a better way to refresh it?

Yes. Use a form, submit the form, let the server return the appropriate
page.


this is not the design that I have for this particular feature.
everything works except for that refresh problem and instead of
suggesting a better solution to refresh the page (e.g. using "header"
and whatnot), you try to be all witty, yet fail miserably at it.


I was not being witty, straight forward and honest.

If you are experimenting with AJAX then you at least need to know it's
limitations though.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 25 '06 #4
Randy,
1. http://www.modernmethod.com/sajax/
http://www.ajaxtoolbox.com/

Will give you the same benefits, with an added one. Its free and it's
author post in this very newsgroup.


Thanks for the suggestion -- it does looks good but more of JS instead
of PHP/JS implementation.
2. the AJAX method is as "secure" as any "form submission". used with
SSL and a properly coded server script, there are no security concerns


I disagree but it's irrelevant.


Tell this google whose AJAX authentication you use to sign in to post
in this newsgroup :) Again, nothing is secure.
If the requested page has # in it (http://localhost/whatever/#), it
refreshes in Internet Explorer but not in Firefox. Any ideas why?
No music comes out of my speakers, any ideas why? The point is, you
aren't giving enough information. But that is not the problem. The
problem is that you are using the wrong approach to logging in.


1. works fine in Internet Explorer


Internet Explorer isn't a good base reference for what works on the web
though.
2. authentication is for everything beyond the /whatever/ point. "#"
just happens to be the page requested by a user. regardless, "#12" or
any other anchor value doesn't work either.


If the script returns history.go(0) then it should refresh the browser.
If you don't want the page refreshed (which is what SAJAX's main selling
point appeared to me to be) then don't. Just set the
document.location.hash property. Not sure what your purpose of using the
hash is for though :\


Here is how my script functions:

Everything within a restricted zone is filtered through index.php that
checks for a registered session. If none is found, it feeds you a login
page (mind you, the URL does not change: so, if you initially opened
http://xxx.com/yy/ then that's where you will get the login). As you
type your password, it is automatically checked by the server script
(AJAX method) against the correct one in the DB. If the password
matches, the server script registers the session and returns
"history.go" to the the browser. If the page is now refreshed, whatever
it is that you initially requested will be fed to you.

I do understand that eval() is not the preferred method, but I do not
know any better method since if I return a JS code in my dynamic
content (by changing DIV's innerHTML), it is not automatically
executed. And all I need to do is to refresh my page. I can return a
var "security = OK" (or some other response) or I can return that
"history()" and run eval on it.

Cheers.

Feb 25 '06 #5
na************@msn.com said the following on 2/25/2006 11:52 AM:
Randy,
1. http://www.modernmethod.com/sajax/ http://www.ajaxtoolbox.com/

Will give you the same benefits, with an added one. Its free and it's
author post in this very newsgroup.


Thanks for the suggestion -- it does looks good but more of JS instead
of PHP/JS implementation.


It is. The server-side part is up to you, the AjaxToolbox covers the
client side.
2. the AJAX method is as "secure" as any "form submission". used with
SSL and a properly coded server script, there are no security concerns

I disagree but it's irrelevant.


Tell this google whose AJAX authentication you use to sign in to post
in this newsgroup :) Again, nothing is secure.


I would, except, I don't use Google to post to this newsgroup so I don't
use AJAX to authenticate to post in this newsgroup :)
> If the requested page has # in it (http://localhost/whatever/#), it
> refreshes in Internet Explorer but not in Firefox. Any ideas why?
No music comes out of my speakers, any ideas why? The point is, you
aren't giving enough information. But that is not the problem. The
problem is that you are using the wrong approach to logging in.
1. works fine in Internet Explorer

Internet Explorer isn't a good base reference for what works on the web
though.
2. authentication is for everything beyond the /whatever/ point. "#"
just happens to be the page requested by a user. regardless, "#12" or
any other anchor value doesn't work either.

If the script returns history.go(0) then it should refresh the browser.
If you don't want the page refreshed (which is what SAJAX's main selling
point appeared to me to be) then don't. Just set the
document.location.hash property. Not sure what your purpose of using the
hash is for though :\


Here is how my script functions:

Everything within a restricted zone is filtered through index.php that
checks for a registered session. If none is found, it feeds you a login
page (mind you, the URL does not change: so, if you initially opened
http://xxx.com/yy/ then that's where you will get the login). As you
type your password, it is automatically checked by the server script
(AJAX method) against the correct one in the DB.


Wow. Sounds like Google's smart thingy. But its overkill :) Only need to
connect to the server once, not every time I press a key but as a
learning exercise, OK :)

If the password matches, the server script registers the session and returns
"history.go" to the the browser. If the page is now refreshed, whatever
it is that you initially requested will be fed to you.
document.location.reload();

Should do what you want.
I do understand that eval() is not the preferred method, but I do not
know any better method since if I return a JS code in my dynamic
content (by changing DIV's innerHTML), it is not automatically
executed. And all I need to do is to refresh my page. I can return a
var "security = OK" (or some other response) or I can return that
"history()" and run eval on it.


var security = true;

if (security){
document.location.reload();
}
else{
authenticate();
}

Where authenticate() would authenticate the user.

I just don't see the need to make your login dependent on JS when it
isn't required. User fills in a form, user submits form, server
authenticates, returns new page. And all that can be done with a single
page.

AJAX is also one of the least widely supported methods for doing what
you are doing.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

Feb 25 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: BadOmen | last post by:
I have used WinObj=window.open ("http://www.some_page","Holder") No I want to press a button in an other window and make the Holder windows history.go(-1) is that possible? (I'm not using a...
1
by: John Giblin | last post by:
I am using the history.go(-1) on a submit button perfectlly in IE5. But it does not work when I populate the input type=select dynamically. What happens is a I have a popup add options to the...
20
by: Dan | last post by:
Is there a way to obtain the last page visited? I don't want to go to that page, I just want to be able find out what page they came from, the url of that page. Is this possible?
8
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?...
3
by: pentisia | last post by:
Hi there, We are using history.go(integer) to go back to the certain page directly. Because there are some pages interaction in between. For example, starting from page 1 to page 2. From page...
3
by: Niall | last post by:
When I say 'last', I mean (eg.) the 100th item in a 100-item history list, *not* the immediately previous one! The problem is, the history.go() method only allows *relative* movement through...
7
by: mohammed.naghman | last post by:
Hi, I have 2 submit buttons in a jsp page. One of them takes me to page2.jsp and also passes the values enetered to page2.I have a link in the page2 that does a history.back to come to the...
10
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you...
2
by: Max | last post by:
I recently moved to ASPnet Ext 3.5 What I can't get with Ajax and History browser managemet is this: User fills some fields (dropdown and textbox) on page 1 (all are in an update panel) User...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.