Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

disable local back button when specific page loads in iframe

Posted on 2009-03-30
3
506 Views
Last Modified: 2012-06-21
I have a back button on my main site.  I have a blog (with blogger) that loads into an iframe.  I also have a cname from my site pointing there, so blog.mysite.com.  I'm assuming the browsers are referencing it as a different site.  So that's what I'm trying to do, disable the back button once my blog is up, but have it enabled any other time.  I've tried multiple things that I think should work, but none have so far.  I figured I could pass a function from the blog site up to the parent, but nothing so far.  Thanks in advance
0
Comment
Question by:pro-tek
3 Comments
 
LVL 17

Expert Comment

by:Thomas4019
ID: 24025666
If what you are tying to do is prevent the person from accidently hitting back then i think you should use the window.onunload javscript event. I dont think there is any good way to disable the back button otherwise.
0
 
LVL 12

Expert Comment

by:Dimitris
ID: 24026600
Yes the back button can not be disabled in any way.

Only the Javascript as Thomas says is a solution but I don't know if its a good idea because you may create a kind of annoying message for the users...
0
 

Accepted Solution

by:
pro-tek earned 0 total points
ID: 24027494
It's a scripted back button, not the browser back, so what I ended up doing was made another page1 (on my domain) put the script in to dissable the back button on my page and nested blog.mysite.com on that page1. Then on the main page the src is now page1 instead of blog.mysite.com and that took care of it.  
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question