Jump to content

Go back 1 page in history ...


xProteuSx

Recommended Posts

just to present another alternative using a standard hyperlink will do what you have asked the seccond time , the reason you need javascript for the first is because you actually need to make a query on the clients end , if however your actually telling the link to go to a specific spot on your server then you can just use somethign like bellow

[code]<a href="./index2.html">text you want for link </a>[/code]

personaly I use things like javascript and other client side scripting languages as little as possible .

peopel have had problems with things like malware through enabling client side scripting over the years , and 80% of doccuments that tell people how to get a bit more security from their browser advise the imediate disabling of things like javascript. ( although the trend of people enabling it due to security improvements has increased it's still not to a level you can count on )

Something thats good practice to keep in mind at all times when developing for the web  is usability across various platforms , settings , browsers and ofcourse the loading times . So if you can use a simple thing like a hyperlink then there is no need to be using javascript for it if however your just practicing and learnign allogn the way it's alwasy good experiance to use it as much as possible
Link to comment
Share on other sites

[quote author=Fallen_angel link=topic=116935.msg476800#msg476800 date=1164953541]
by any chance where you using a script tag ?
if so thats why it didn't let it post , I had the same issue a few weeks ago , if you replace the javascript tags though you will be fine and it will post the message
[/quote]
Ah, gotcha, thanks for the heads up, it was a script tag.  I couldn't figure out for the life of me why on earth this was happening.  I've never been too fond of SMF forums, they're a pain in the ass to mod as well.  You'd think you could simply use htmlentities() and strip out the html blocks or replace the script tag and all would be well... guess not
Link to comment
Share on other sites

yeah I spent a good 2 hours the other week slappin myself tryign to figure out where I was goign wrong , hehe
haven't used SMF before , am more of an ipb person myself however it doesn't seem to bad at all for a free alternative

one day I want to write my own forums , but I have allot to learn first hehe



Link to comment
Share on other sites

Fallen_Angel, I could not use a simple link such as <a href="./index2.html">text you want for link </a>.  The reason is a little difficult to explain but I will try ...

My first page, page1.php, has a form with some variables.  When you hit Submit you are taken to page2.php which processes the variables from page1.php, and has a form of its own.  When you hit Submit on the second form on page2.php you are taken to page3.php which processes the variables from the form from page2.php.  If there is an error in the variables received by page3.php from the form from page2.php I want a back button on page3.php so that the user can re-enter the info into page2.php.  If, however, I use a simple link what happens is that the browser re-sends for page2.php from the web server, but it does not have the values from page1.php, so there are a series of errors.  If, however, I use the history.back() function of javaScript the page is reloaded from cache, with variables intact.

Hope I didn't make anyone dizzy ...
Link to comment
Share on other sites

Sorry I think there may be some confusion in what I was sugesting , my first post gave you the answer to your first question

my seccond post was answering how you could make a link there to take you to another page besides back ,

I assumed that you would not need a link from a page in a form to another page ,because  I would image you already defined that in the form tag itself , so all you need is a standard submit button.

from the sounds of your explination  you just need the  back button and your standard submit buttons so please ignore my seccond post and just use whats in the first  sorry I misunderstood your seccond post

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.