SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: target="_top"

  1. #1
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    target="_top"

    I have some javascript, and it does something in the same window. The problem is that I use iframes. So, I want the javascript target to be "_top" so that the javascript would do the action for the whole page.

    Here's my code:

    <select name="games" id="games" onchange="switchme()">
    <option class="headname" selected>Select a Game</option>

    PHP Code:
    <script type="text/javascript">
     <!--<![
    CDATA[
     function 
    switchme(){
         if(
    document.getElementById('games').value != ''){
             
    window.location document.getElementById('games').value;
         }
     }
     
    //]]>-->
     
    </script> 

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand what you are trying to ask correctly, then you want to change "window.location" to "parent.location.href".
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz
    If I understand what you are trying to ask correctly, then you want to change "window.location" to "parent.location.href".
    Yes, that's exactly what I was asking It works, thanks alot


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •