what is wrong with this tag?


I'm using follwoing tag but it is not working. What is wrong?!

<input style="margin-left:5px;" type="button" onclick="javascript:history.go(-1);" value="Back" class="inputsubmit" />      

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b0lsc0ttIT ManagerCommented:

Try ...

<input style="margin-left:5px;" type="button" onclick="window.location.history.go(-1);" value="Back" class="inputsubmit" />

... if that doesn't work then ...

<input style="margin-left:5px;" type="button" onclick="window.location.history.back();" value="Back" class="inputsubmit" />

Let me know if you have any questions or need more information.

akohanAuthor Commented:


Thanks for your response. Unfortunatley, none of them works since I'm using it under Facebook and it doesn't accept window.location or ....
It seems everything should be FBJS (FB JavaScript standard!) compliant.


b0lsc0ttIT ManagerCommented:
>> It seems everything should be FBJS (FB JavaScript standard!) compliant <<

Yes.  You can't use something they designed to stop and block.  Now I understand why you had the problem.  If you wanted an alternate way to do it then there isn't.

If you knew the URL could you use window.location.href = "thepage.htm" in a Facebook page?  I have an idea they will stop that too if the prevent the above but you could try it.  That would only be useful though if you were willing to hardcode the URL/page; no fancy "back" link.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
akohanAuthor Commented:

>>> If you knew the URL could you use window.location.href = "thepage.htm" in a Facebook page?

No, since facebook uses a parser and replaces all the variables so I won't know what would happend to a name or variable. It is pretty annoying.

Thanks for your resonse.
b0lsc0ttIT ManagerCommented:
Your welcome!  Thanks for the grade, the points and the fun question.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.