I built a facebook tab which has a form to fill out. However below the form there is a link to a terms and conditions page which sits on a different URL from the form.
The form is on: page/like and the T&C page is on page/terms
In the T7C page there is a back button which inside the href has the following:
href="javascript:window.history.back()"
and this button suppose to bring you back to the form after you have red the T&C.
This works fine on a testing server, however as soon as it's embedded in facebook the back button stops working and it doesn't go back to the form but to the home page of the brand.
The other issue that I have just came across is the if I fill out some of the fields and then I click on the T&C page and go back to the form using the back button the input fields are all empty.
Is there a way front-end side that this can be fixed too?
I built a facebook tab which has a form to fill out. However below the form there is a link to a terms and conditions page which sits on a different URL from the form.
The form is on: page/like and the T&C page is on page/terms
In the T7C page there is a back button which inside the href has the following:
href="javascript:window.history.back()"
and this button suppose to bring you back to the form after you have red the T&C.
This works fine on a testing server, however as soon as it's embedded in facebook the back button stops working and it doesn't go back to the form but to the home page of the brand.
The other issue that I have just came across is the if I fill out some of the fields and then I click on the T&C page and go back to the form using the back button the input fields are all empty.
Is there a way front-end side that this can be fixed too?
Share Improve this question edited Jun 7, 2013 at 14:58 Aessandro asked Jun 7, 2013 at 14:17 AessandroAessandro 5,77121 gold badges72 silver badges146 bronze badges 1- its possible that the anchor click is causing the history to increment by one. (just a hunch) – DevZer0 Commented Jun 7, 2013 at 14:20
3 Answers
Reset to default 3Does the console tell you anything?
Try window.history.go(-1);
.
Alternatively, have you tried opening the T&C in a separate window using target="_blank"
? If you are worried about making sure the terms are read, inside the opened window, you may be able to run a function in the parent window using window.opener.readTC()
, where .readTC
is your function.
You can wrap this in a button:
<button type="button" onclick="window.history.go(-1)">Go back</button>
Try this example...
<html>
<head>
<script>
function goBack()
{
window.history.back()
}
</script>
</head>
<body>
<input type="button" value="Back" onclick="goBack()">
</body>
</html>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742332903a4424075.html
评论列表(0条)