Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2009, 03:45 PM
Contributing Member
Latest Blog:
None

 
Join Date: 12-14-08
Posts: 140
iTrader: 0 / 0%
2939195631902 is liked by many
Lightbulb "back button script" javascript:history.go(-1) doesn't work in IE??

I've been using this script for a back button i built for my site.


<a href="javascript:history.go(-1)"><div id="back_button"><img src="../direct_images/back_button.gif" /></div></a>


However, i had just realized it does work for IE while works fine in other browsers including chrome, ff, ...

Does anyone know whats wrong with this piece of code?

Thx
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #2 (permalink)  
Old 02-17-2009, 08:38 PM
Izzmo's Avatar
v7n Mentor
Latest Blog:
Starting p90x today

 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,346
iTrader: 1 / 100%
Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Hmm, not the best way to go back to a previous page, but this should work fine in IE7.

Can you post the code around this?
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #3 (permalink)  
Old 02-17-2009, 08:49 PM
Contributing Member
Latest Blog:
None

 
Join Date: 12-14-08
Posts: 140
iTrader: 0 / 0%
2939195631902 is liked by many
Well, i pasted the same code:

<a href="javascript:history.go(-1)"><div id="back_button">Back</div></a>

into a new .php page to see if it works or not.

And it does work in chrome but not IE7. I thought it might be my browser, but then i found out that code doens't work in FF either.

As of right now, the new page test.php with that back button statement has no other codes in the page.

Any more suggesitons?
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #4 (permalink)  
Old 02-17-2009, 09:29 PM
htmlbasictutor's Avatar
Super Moderator
Latest Blog:
Website Testing

 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 4,553
iTrader: 0 / 0%
htmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest order
The JavaScript Source: Navigation: Back Button
__________________

HTML Basic Tutor - Learn to code your web pages/blogs
Basic Computer Information - Computer Basics for website owners


Trouble getting indexed? Maybe it's something technical - Pm me.
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #5 (permalink)  
Old 02-18-2009, 10:43 AM
Izzmo's Avatar
v7n Mentor
Latest Blog:
Starting p90x today

 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,346
iTrader: 1 / 100%
Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Good link, but that doesn't seem to work.

I haven't used this type of JavaScript back button in a long time! So, maybe the new versions of browsers have deprecated it? Not sure..
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #6 (permalink)  
Old 02-18-2009, 11:17 AM
htmlbasictutor's Avatar
Super Moderator
Latest Blog:
Website Testing

 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 4,553
iTrader: 0 / 0%
htmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest orderhtmlbasictutor is a web professional of the highest order
Works in IE7 and FF3.

Maybe because this forum is set up to open links in a new window, you didn't have a previous page to go back to?
__________________

HTML Basic Tutor - Learn to code your web pages/blogs
Basic Computer Information - Computer Basics for website owners


Trouble getting indexed? Maybe it's something technical - Pm me.
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #7 (permalink)  
Old 02-18-2009, 11:41 AM
Izzmo's Avatar
v7n Mentor
Latest Blog:
Starting p90x today

 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,346
iTrader: 1 / 100%
Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Hmm, that would have been why. Can't believe I didn't notice that! lol...

Had a weird reaction though, it was go forward instead in FF (just go forward to the same page). Weird.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #8 (permalink)  
Old 02-18-2009, 05:23 PM
Contributing Member
Latest Blog:
None

 
Join Date: 06-11-07
Posts: 238
iTrader: 0 / 0%
Capo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the rough
I know it's not exactly the same, but since you're using php, why don't you just use
$_SERVER['HTTP_REFERER']
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #9 (permalink)  
Old 02-19-2009, 04:54 AM
Contributing Member
Latest Blog:
None

 
Join Date: 12-14-08
Posts: 140
iTrader: 0 / 0%
2939195631902 is liked by many
cross compatible?
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #10 (permalink)  
Old 02-19-2009, 07:58 AM
Izzmo's Avatar
v7n Mentor
Latest Blog:
Starting p90x today

 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,346
iTrader: 1 / 100%
Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Well, as long as your server supports PHP, then yes. But it's not javascript. Instead this will sender a header to your browser telling it to go to another page, which is compatible in all browsers.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #11 (permalink)  
Old 02-19-2009, 08:29 AM
Contributing Member
Latest Blog:
None

 
Join Date: 06-11-07
Posts: 238
iTrader: 0 / 0%
Capo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the roughCapo64 is a jewel in the rough
if you set up a link like this:

<a href="<?=$_SERVER['HTTP_REFERER']?>">Go Back</a>

And you clicked a link from google.com to come to your website. It will render like this:

<a href="http://www.google.com">Go Back</a>
Digg this Post!Add Post to del.icio.us
Reply With Quote
  #12 (permalink)  
Old 02-20-2009, 09:39 AM
Izzmo's Avatar
v7n Mentor
Latest Blog:
Starting p90x today

 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,346
iTrader: 1 / 100%
Izzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web proIzzmo is a highly respected web pro
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Capo is correct. That would be the way to do it.

Except that's ASP style, and most servers don't support that.

So it would actually be:

PHP Code:
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?>">Go Back</a>
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Digg this Post!Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
should a navigation bar include a "home" button? BostonWebPaul Web Usability 22 09-22-2009 01:48 AM
Search engine bots "seeing through" Javascript? Shockt SEO Forum 2 12-03-2006 05:13 PM
Home page with "latest news", "news archive" and "update" tekitouni Web Design Lobby 1 09-19-2006 08:39 PM
Funny JavaScript "complicatedness"! webzenstar Coding Forum 2 09-17-2006 01:57 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


Site Navigation: v7n Home .::. Graphics .::. Scripts .::. V7N Web Directory .::. V7N Technology Blog .::. V7N Affiliate Program .::. Advertise

Partners: Search Engine Optimisation .::. Dedicated Server Hosting .::. Webmaster Talk .::. CPA Affiliates .::. Dedicated Server Hosting

Site Sponsored by a Hivelocity Dedicated Server.
SEO Consult, International SEO Experts
Dedicated Server Hosting
All times are GMT -7. The time now is 12:16 PM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.